Making scrollbars work with the WeifenLuo Dock Panel Suite
I have the following code, which is basically a ToolStrip menu item:
private void addRoomToolStripMenuItem_Click( object sender,
System.EventArgs e )
{
frmRoom newRoom = new frmRoom();
dockPanel.Scroll += dockPanel_Scroll;
dockPanel.VerticalScroll.Visible = true;
dockPanel.VerticalScroll.Enabled = true;
dockPanel.VerticalScroll.Maximum = newRoom.Height;
dockPanel.VerticalScroll.SmallChange =
dockPanel.VerticalScroll.Maximum / 8;
dockPanel.VerticalScroll.LargeChange =
dockPanel.VerticalScroll.Maximum / 4;
newRoom.Show( dockPanel, DockState.Document );
}
void dockPanel_Scroll( object sender, ScrollEventArgs e )
{
dockPanel.VerticalScroll.Value = e.NewValue;
}
For some reason I cannot get the vertical scrollbar to work properly with
the Dock Panel Suite. The scrollbar always goes to the top and the dock
panel does not scroll up as expected.
As there is no documentation on the web for this control I am hoping that
somebody can point me in the right direction.
Thanks.
No comments:
Post a Comment