How can I change the style of selection?

I can select few objects in GoDiagram. But I don’t like the style of this selection. Selection, not bounds around every object, only the whole selection! For example, I would like my selection rectangle will pink.
How can I do it?

You can control the color by setting GoView.PrimarySelectionColor and .SecondarySelectionColor.
I’m not sure what appearance you want for selection handle(s), but in general you can do whatever you want by overriding GoObject.AddSelectionHandles. There are a number of examples–particularly in the Demo1 sample.

I’m interesting not borders around objects, I’m interesting rectangle that is selection region. It’s XOR line, I don’t like its appearance and I want to change it.

The natural thing to do then is to change the behavior of GoToolRubberBanding so that it doesn't call GoView.DrawXorBox. But then it occurred to me that overriding that method not to call GoView.DrawXorRectangle might be easier to implement for you. I haven't tested this, but you'll want to define a class inheriting from GoView that does something like: public override void DrawXorBox(Rectangle rect, bool drawnew) {
// erase any previous rectangle
if (myPrevXorRectValid) {
Rectangle r = myPrevXorRect; r.Inflate(3, 3); Invalidate(r); Update();
myPrevXorRectValid = false;
} if (drawnew) {
Graphics g = CreateGraphics(); g.IntersectClip(this.DisplayRectangle);
g.DrawRectangle(Pens.Gray, rect.X, rect.Y, rect.Width, rect.Height);
g.Dispose();
myPrevXorRect = rect;
myPrevXorRectValid = true;
}
} private Rectangle myPrevXorRect = new Rectangle();
private bool myPrevXorRectValid = false; Of course you can modify the call to Graphics.DrawRectangle to do whatever you like.

By the way, on what I think is an separate but related topic, in version 2.3 you can set GoView.SelectInRectangleStyle to control whether the GoToolRubberBanding.Box has to completely surround each selectable object’s SelectionObject, or whether it just needs to intersect it, in order to actually select the object.

Thank you! I will try it and tell you wether here is result.

Hmm, it would be more efficient to call:
Invalidate(myPrevXorRect); Update();
instead of:
Refresh();
Again, I haven’t tried this…

Actually it would be better to draw selection rectangle this way and
besides of that if would be good to scroll the diagram when rubberband
hits borders, default implementation looks strange i mean drawing over regions outside the diagram.

I have corrected the code in my post defining DrawXorBox.
We’ll add a GoView.DrawsXorMode property for version 3.0.
You can turn on GoToolRubberBanding.AutoScrolling in version 2.3.

Thank you, Walter, very much!
After changing some features you code have worked OK!
The one problem was to understand how the coordinated were changing while changing of selection region. But after while all the things became right.
thanks!
(I was on vacation so I answer only now.)