473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to have scrollbars in a user control

Raj
Hi,
I would like to have my user control to support scrollbars. So that when the
user control is embeded in a pane/view, and the view size is reduced to less
than the size of the usercontrol, the user control must show scroll bars.

Currently I tried by setting the AutoScroll property to true. Also, I
handled the 'Form1_SizeChanged' event for the form. Here I invoke a 'Resize'
routine defined by the UserControl - 'ResizeControl' :-

public void ResizeControl(int width, int height)

{
this.Left = 10;

this.Top = 10;
this.Height = (height - 20) ;

this.Width = (width - 20) ;


}

But I am finding that the scrolbars are not appearing correctly. Only one
scrollbar appears at a time?

Please suggest possible solutions!

Thanks & Regards,

Rajendra


Nov 17 '05 #1
1 7581
Hi,

To force the scroll bars to appear, you might try to adjust the value of the
AutoScrollMinSize property rather than changing the size of the control
itself.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Raj" <ra*************@networkgeneral.com> wrote in message
news:eP**************@TK2MSFTNGP10.phx.gbl...
Hi,
I would like to have my user control to support scrollbars. So that when
the user control is embeded in a pane/view, and the view size is reduced
to less than the size of the usercontrol, the user control must show
scroll bars.

Currently I tried by setting the AutoScroll property to true. Also, I
handled the 'Form1_SizeChanged' event for the form. Here I invoke a
'Resize' routine defined by the UserControl - 'ResizeControl' :-

public void ResizeControl(int width, int height)

{
this.Left = 10;

this.Top = 10;
this.Height = (height - 20) ;

this.Width = (width - 20) ;


}

But I am finding that the scrolbars are not appearing correctly. Only one
scrollbar appears at a time?

Please suggest possible solutions!

Thanks & Regards,

Rajendra


Nov 17 '05 #2

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

Similar topics

0
by: msnews.microsoft.com | last post by:
Hello, I am trying to remove the scrollbars from any page I load up into the browser control on a window form. I first tried the following: browserDoc = (mshtml.HTMLDocument)browser.Document;...
0
by: Kenneth H. Brannigan | last post by:
Hello, I am trying to remove the scrollbars from any page I load up into the browser control on a window form. I first tried the following: browserDoc = (mshtml.HTMLDocument)browser.Document;...
0
by: Tor Inge Rislaa | last post by:
How to control the scrollbars in datagrid In VB 6.0 you could control if you wanted the scrollbars to be automatic on when needed or if you just wanted to show vertical or horizontal scrollbar....
10
by: GTi | last post by:
I have a popup window, If this window is to smaal the scrollbars is visible. Is there any JavaScript available so I can check if the scrollbars is visible on page (right and bottom side)? Then I...
5
by: james | last post by:
How can I control the placement of scrollbars in mdi child windows? I need to place a control at the top of my child form and this control needs to always be visible. The rest of the page needs...
1
by: TomasFloyd | last post by:
Hi Everyone I'm using the standard ListView control of VS 2003. I would like to know if there is a way to catch the event of the scrollbars attached to a ListView being 'scrolled' or 'clicked'?...
0
by: Sin Jeong-hun | last post by:
I need to create a table user control. The table will display many cells so this control requires scrollbars should be displayed when some cells cannot be displayed. At first, I draw the table on a...
7
by: panks2007 | last post by:
Hi, The scrollbars property in one activex which works similar to scrollbars property of textbox control when click on the region between slilder and arrow its moving either end. so, how to...
1
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, Is there a way to detect whenever scrollbars (the vertical) are shown on a treeview I need to know. 1) If scrollbars are visible after a rezise 2) If scrollbars are visible after change...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.