Hi Stoyo,
1. I placed the new scollbars on the right and bottom of the diagram view, so the diagram view and the scrollbars are placed on a container panel, the scrollbars docked to the right and bottom and the diagram view filled in that container panel.
But it seams that if I set ShowScrollBars = false (no matter if new scrollbars are placed on the container panel or not), the border gap disappears.
The only way to overcome this unwanted behavior is to place the diagram view in its own container panel and set the Padding property to this panel. Is there another way to show that border gap and also to have "ShowScrollBars = false" ?
2. Thanks, that seems to handle all situations when the scrollbars are redimensioned. But I have a problem. I used this code which is called from the ScrollChanged, BoundsChanged and ZoomChanged event handlers:
internal void SetCustomScrollBars()
{
//diagramView.VScrollBar.Visible = true;
//diagramView.HScrollBar.Visible = true;
if (diagramView.HScrollBar == null || !diagramView.HScrollBar.Visible)
{
horizontalScrollbar.Visible = false;
}
else
{
horizontalScrollbar.Visible = true;
horizontalScrollbar.Minimum = diagramView.HScrollBar.Minimum;
horizontalScrollbar.Maximum = diagramView.HScrollBar.Maximum;
horizontalScrollbar.SmallChange = diagramView.HScrollBar.SmallChange;
horizontalScrollbar.LargeChange = diagramView.HScrollBar.LargeChange;
horizontalScrollbar.Value = diagramView.HScrollBar.Value;
}
if (diagramView.VScrollBar == null || !diagramView.VScrollBar.Visible)
{
verticalScrollbar.Visible = false;
}
else
{
verticalScrollbar.Visible = true;
verticalScrollbar.Minimum = diagramView.VScrollBar.Minimum;
verticalScrollbar.Maximum = diagramView.VScrollBar.Maximum;
verticalScrollbar.SmallChange = diagramView.VScrollBar.SmallChange;
verticalScrollbar.LargeChange = diagramView.VScrollBar.LargeChange;
verticalScrollbar.Value = diagramView.VScrollBar.Value;
}
//diagramView.VScrollBar.Visible = false;
//diagramView.HScrollBar.Visible = false;
}
...and it's working very well but only when the ShowScrollBars=
true. And in this case both scrollbars pairs are displayed, so I need to hide the original one. My problem is that if I set the ShowScrollBars=
false the diagramView.HScrollBar and diagramView.VScrollBar are null so I can't use them anymore to copy their settings into the new ones.
I tried (the first and last 2 lines commented) to hide the original scrollbars on runtime (ShowScrollBars=
true) but it does not work. They still appear.
Can you give me a hint on how to simulate the original scrollbars min/max/small/large properties updates into the new scrollbars?
Thanks,
Bogdan