GoView Rubberband


Is there a way I can override the rubber band on the GoView… I want to change it from that black to say green or blue… and give it a alpha blended background color… is this doable?


That’s controlled by GoToolRubberBanding, which just calls GoView.DrawXorBox.
In Windows Forms, GoView.DrawXorBox calls GoView.DrawXorRectangle, which calls ControlPaint.DrawReversibleFrame. You could override the implementation of GoView.DrawXorBox to do what you want.


Great thanx man…


This isn’t that easy :) I repainted both my monitors with a few thousand rubberbands… :)

OK, here's a greatly simplified version of the implementation that GoView has: public virtual void DrawXorBox(Rectangle rect, bool drawnew) {
// erase any previous rectangle
if (myPrevXorRectValid) {
myPrevXorRectValid = false;
} if (drawnew) {
myPrevXorRect = rect;
myPrevXorRectValid = true;
} public void DrawXorRectangle(Rectangle rect) {
Rectangle screenRect = RectangleToScreen(rect);
ControlPaint.DrawReversibleFrame(screenRect, this.BackColor, FrameStyle.Thick);
} private Rectangle myPrevXorRect = new Rectangle();
private bool myPrevXorRectValid = false;