hi all,
i need to create vertical scrollbar dynamically for the controls
that are created dynamically in the form. (i'm not adding any controls
to the panel). when the form exceeds(coz of dynamic controls creation)
the default system coordinates, vertical scroll bar should be
dynamically produced in the form.
in this case i could produce the vscrollbar dynamically. but when
i'm scrolling the form,the controls which are down couldn't be
scrolled up.
i'm doing it in this way,
if(height >= 600)
{
vsb=new VScrollBar();
vsb.Dock=DockStyle.Right;
vsb.Maximum = 600;
vsb.LargeChange = 250;
vsb.ValueChanged +=new EventHandler(vsb_ValueChanged);
Controls.Add(vsb);
}
...
...
...
private void vsb_ValueChanged(object sender, EventArgs e)
{
this.Top = -vsb.Value;
}
any suggestion in this regard would be greatly appreciated.
Thanks and Regards
chris
Phil Williams - 15 Feb 2005 11:39 GMT
Hi Chris,
Couldn't you just set your forms AutoScroll property to true?
This way, scrollbars will automatically appear when needed, and disappear
when they are not.
Hope this helps.
All the best.
Phil.
> hi all,
>
[quoted text clipped - 32 lines]
> Thanks and Regards
> chris
christopher jayaseelan - 15 Feb 2005 13:00 GMT
thank u very much william, i didn't see the things on that perspect, as
i'm new to c#. thanks for yr timely help.
chris - 15 Feb 2005 13:08 GMT
hi all,
i got the answer from william.
it can be solved if we make autoscroll property of the form be true.
thanks and regards
> hi all,
>
[quoted text clipped - 32 lines]
> Thanks and Regards
> chris