473,770 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vertical scrolling for windowsforms in c#

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=DockSt yle.Right;
vsb.Maximum = 600;
vsb.LargeChange = 250;
vsb.ValueChange d +=new EventHandler(vs b_ValueChanged) ;
Controls.Add(vs b);
}
....
....
....

private void vsb_ValueChange d(object sender, EventArgs e)
{
this.Top = -vsb.Value;
}
any suggestion in this regard would be greatly appreciated.

Thanks and Regards
chris
Nov 16 '05 #1
2 8492
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.

"chris" wrote:
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=DockSt yle.Right;
vsb.Maximum = 600;
vsb.LargeChange = 250;
vsb.ValueChange d +=new EventHandler(vs b_ValueChanged) ;
Controls.Add(vs b);
}
....
....
....

private void vsb_ValueChange d(object sender, EventArgs e)
{
this.Top = -vsb.Value;
}
any suggestion in this regard would be greatly appreciated.

Thanks and Regards
chris

Nov 16 '05 #2
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
chris

ch*******@gmail .com (chris) wrote in message news:<70******* *************** ****@posting.go ogle.com>...
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=DockSt yle.Right;
vsb.Maximum = 600;
vsb.LargeChange = 250;
vsb.ValueChange d +=new EventHandler(vs b_ValueChanged) ;
Controls.Add(vs b);
}
...
...
...

private void vsb_ValueChange d(object sender, EventArgs e)
{
this.Top = -vsb.Value;
}
any suggestion in this regard would be greatly appreciated.

Thanks and Regards
chris

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11013
by: Don Schneider | last post by:
I tried to setup a frameset which consists of 4 different subframes. Each of these subframes should fetch a different web page from the internet and display it completely (!). BUT: the vertical size should be undefined. Depending on the retrieved (lets say 2nd) webpage the frame should take as much space as it needs to display the whole sub web page without vertical scrollbar. If I implement it like below a vertical scrollbar for each of...
5
20233
by: Z | last post by:
Hi, I have problem with auto-scrolling frames in IE (6.0 on Xp, but same happens with IE 5.5 on Win2k): If I set scrolling="auto" to frame, IE reserves space where vertical scrollbar normally goes and doesn't render contents there when scrollbar is hidden. Here is frameset with left and right frames:
7
15633
by: bienwell | last post by:
Hi, I'm using the CheckBoxList control in ASP.NET for Web development. This checkboxlist is bound by the database. If we have more items for this checkbox list, it takes space on the page. I want to have vertical scroll bar (like CheckedListBox in Window development) to save space. Can we do that in ASP.NET ? Please give me your suggestions ? Thanks in advance.
1
2357
by: Oberfuhrer | last post by:
Hello all VB.net friends ! i have done most of my programming in assembly, at least so far. Recently i decided to learn a high level language for windows programming. I didnt take long to realize that VB.net would be my perfect friend. I have already rewritten most of my assembly controls in VB, but i am not satiesfied with the scrolling performance, though. In assembler, where you can write directly to the video memory, this
2
2976
by: P2P | last post by:
Hi I am wondering if someone know of a free cross-browsers vertical scrolling script that - is cross cross-browsers - will call the scrolling content from an external html page or from a url page
3
5395
by: lolo | last post by:
hello. happy new year. I'm trying to build a website for my wife and she is adament on having a horizontal thumbnail scrolling div. great. I have a good vertical scrolling thing, but can't figure out how to make it scroll horizontally. It's probably real simple and I just can't figure it out.... Here is the code I have so far:
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10037
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.