473,385 Members | 1,588 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,385 software developers and data experts.

Adding scrollbars to a usercontrol, HOW?

Hi, this may sound silly but I want to have some scrollbars used by a
user-control that is resized. And what I don't want to do is, in the
user-control code, for example

Me.AutoScrollMinSize=new Size(200,200)

What this does is that when the user control is smaller than 200,
horizontal and/or vertical scrollbars automatically appear. I want my
scrollbars to appear somewhere else, not surrounding the usercontrol.
Actually I don't even want them to appear, they are already there - I
just want them used.

Is there a way in the usercontrol to specify the name of the scrollbar
to use? For example, if my scroll bar is somewhere else on the same
form as the usercontrol, and called VScroll1, can I tell the
usercontrol to use this scrollbar?

Thank you
Tony.
Nov 20 '05 #1
1 7753
Nak
> Is there a way in the usercontrol to specify the name of the scrollbar
to use? For example, if my scroll bar is somewhere else on the same
form as the usercontrol, and called VScroll1, can I tell the
usercontrol to use this scrollbar?


Hi,

Just draw 2 scroll bar controls onto your control where you would like
them placed. Reposition them in the resize event of the control. Add the
code necessary yourself, which shouldn't be hard depending on how you want
the scrolling to work.

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #2

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

Similar topics

1
by: Gerben van Loon | last post by:
Hi, I've drawn my own control using GDI+. But the control is bigger than a normal form could display, so I want to add scrollbars. Saw somewhere that you have to inherit from...
0
by: Jack Smash | last post by:
I'm having this seemingly simple problem with my ScrollBars resetting, but I can not figure out why. I have a panel which has a UserControl for my drawing area. The UserControl is much bigger...
0
by: Just Me | last post by:
Given a control1 on a UserControl: After much experimentation I find that the x and y values given to control1.SetBounds(x,y,... needs to have the positions of the scrollbars thumbs subtracted...
2
by: felix | last post by:
Hi, I've a UserControl with the property AutoScroll = true. Thus, when child-controls overlap the visible area, the scrollbars are shown. How do I query the size or width of the scrollbars? In...
1
by: Raj | last post by:
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,...
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...
0
by: MrNobody | last post by:
Here is a quick sample app I made which illustrates the problem I am having making my own UserControl: how do I get scrollbars to appear if I draw something bigger than the ClientSize ? ...
5
by: Charlie Brown | last post by:
I have a user control where I override the paint event and draw the control myself. When I sraw outside of the visible area, I need the scrollbars to appear and allow the user to scroll the...
1
by: raylopez99 | last post by:
Scrollbars scroll bars adding scrollbars in C# Forms 2.0 scrollbars don't work won't work how to add scrollbar in C# Here is how to add a scrollbar to a form. It's not in any book. For future...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...

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.