I am wanting to create my own scrollbars with my own custom painting, but by the looks of it it is not possible to repaint them as I cannot find any methods to override.
Is there a way of doing this.. By either..
A) Overriding something?
B) Just increase the size of both GoOverview and GoView so the Scrollable control can function as it is needed?
If your custom control inherits from System.Windows.Forms.HScrollBar, you can just set GoView.HorizontalScrollBar. The same goes for VScrollBar and GoView.VerticalScrollBar.
If your custom control doesn't inherit from the standard xScrollBar classes, then you can set those two GoView properties to null and then set the GoView.BottomBar and RightBar properties to instances of your control. GoView will automatically stretch and position them, as it does for the regular scrollbars. But you'll need to implement GoView.PropertyChanged event handlers to keep your custom controls up-to-date with the GoView.DocPosition and GoView.DocScale properties.
As a test, I just defined a CustomHScrollBar inheriting from HScrollBar, and then set my view’s HorizontalScrollBar property to an instance of this control. Everything worked as I believe you would expect.
If you aren't inheriting from ScrollBar, that's OK too. For example, it's common to set the GoView.TopBar and .LeftBar to instances of Northwoods.Go.Draw.GoRuler. GoRuler just inherits from System.Windows.Forms.Control, not from ScrollBar.
But if your "bar" doesn't inherit from ScrollBar, GoView won't add the event handlers needed to scroll automatically when the user manipulates the ScrollBar, nor will it update the properties of the ScrollBar as the view's document extent changes. You'll need to implement your own functionality to do so, just as GoRuler does.
I am using the BottomBar and the RightBar attributes, as you mention in the your earlier post... (see below your a pasted in version)
what items should i override in GoView / GoOverView to keep the scrollbars consistant with the bars themselves?
----------------------------- Your Previous Post -----------------------------------
If your custom control doesn't inherit from the standard xScrollBar classes, then you can set those two GoView properties to null and then set the GoView.BottomBar and RightBar properties to instances of your control. GoView will automatically stretch and position them, as it does for the regular scrollbars. But you'll need to implement GoView.PropertyChanged event handlers to keep your custom controls up-to-date with the GoView.DocPosition and GoView.DocScale properties.
You shouldn’t have to do anything. By default setting the GoView.HorizontalScrollBar property also changes the GoView.BottomBar property, since they refer to the same HScrollBar control.
By default the value of GoView.HorizontalScrollBar is a System.Windows.Forms.HScrollBar, which does inherit from ScrollBar.
By default the value of GoView.HorizontalScrollBar is the same Control as the value of GoView.BottomBar.
The same is true for GoView.VerticalScrollBar, VScrollBar, and GoView.RightBar.
I don't understand why you are having any problems. To test this, I defined a CustomHScrollBar class inheriting from HScrollBar. All I did in the constructor was to specify a value for Height.
Then in the initialization of my GoView, I assigned GoView.HorizontalScrollBar to a new instance of CustomHScrollBar. When I ran the application, you could tell immediately that it had a different Height than normal, and that its Width adjusted automatically to match the GoView as the view was resized.
The problem is I need my scrollbars skinned, which is why i need to use a scrollbar that doesn't inherit from scrollbar, I put my scrollbar on the BottomBar like you suggested
I also need to keep the same functionality as before, any ideas?
Well, as I said earlier, GoRuler does not inherit from ScrollBar, but a GoRuler works fine as the GoView.BottomBar, if you don’t want the standard scrollbar there. It’s just that you need to implement a GoView.PropertyChanged event handler to keep track of changes to the GoView.DocPosition and GoView.DocScale properties.
Regarding your other idea, I think that would be easy to implement. Just set those two ...ScrollBar properties to null, and set the GoView.DocPosition and GoView.Size as needed. But I'm not sure that it will work very well, since there's a practical limit on the size of the GoView that you can have, and you'll lose some of the optimizations that we implement.
Now I understand… im on about the scrolling… yes the bar appears in the correct place, sorry about the misunderstanding, im talking about keeping the scrollbar in sync with the godiagram view