Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

Vertical scrolling  for windowsforms in c#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chris - 15 Feb 2005 07:25 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.