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

Scrollbars on User Controls

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 painted area into
view. I can enable and show the scrollbars, but they dont allow
scrolling... What am I missing on this one?

Nov 6 '06 #1
5 1468
AutoScroll = True ?
Nov 6 '06 #2
Took a shot at that one as well, no go. Also tried setting the size to
something and the clientsize to something bigger, but nothing happened
there as well.
Stuart Nathan wrote:
AutoScroll = True ?
Nov 6 '06 #3
First, you have to put the UserControl inside another Control, such as a
Panel, that will serve as the Viewport/Container. Second, you set AutoScroll
to true. Third, you must resize the UserControl so that at least one of its
dimensions exceeds the corresponding dimenstion of the Viewport. And Bob's
your Uncle.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

I just flew in from Chicago with
a man with a wooden leg named Smith
who shot an elephant in my pajamas.
So I bit him.
"Charlie Brown" <cb****@duclaw.comwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
Took a shot at that one as well, no go. Also tried setting the size to
something and the clientsize to something bigger, but nothing happened
there as well.
Stuart Nathan wrote:
>AutoScroll = True ?

Nov 6 '06 #4
Thanks for the advice Kevin, I'll give that a try and post back.
Kevin Spencer wrote:
First, you have to put the UserControl inside another Control, such as a
Panel, that will serve as the Viewport/Container. Second, you set AutoScroll
to true. Third, you must resize the UserControl so that at least one of its
dimensions exceeds the corresponding dimenstion of the Viewport. And Bob's
your Uncle.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

I just flew in from Chicago with
a man with a wooden leg named Smith
who shot an elephant in my pajamas.
So I bit him.
"Charlie Brown" <cb****@duclaw.comwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
Took a shot at that one as well, no go. Also tried setting the size to
something and the clientsize to something bigger, but nothing happened
there as well.
Stuart Nathan wrote:
AutoScroll = True ?
Nov 11 '06 #5
Works well Kevin. Any thoughts on how to do this in code instead of
dropping a control into a container, but actually writing the
scrollbars into your own control.
I tried inheriting a ListView control, but when you set OwnerDraw =
True, the scrollbars need to be handled in the code. unfortunatley I
can't find any code examples anywhere

Charlie Brown wrote:
Thanks for the advice Kevin, I'll give that a try and post back.
Kevin Spencer wrote:
First, you have to put the UserControl inside another Control, such as a
Panel, that will serve as the Viewport/Container. Second, you set AutoScroll
to true. Third, you must resize the UserControl so that at least one of its
dimensions exceeds the corresponding dimenstion of the Viewport. And Bob's
your Uncle.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

I just flew in from Chicago with
a man with a wooden leg named Smith
who shot an elephant in my pajamas.
So I bit him.
"Charlie Brown" <cb****@duclaw.comwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
Took a shot at that one as well, no go. Also tried setting the size to
something and the clientsize to something bigger, but nothing happened
there as well.
>
>
Stuart Nathan wrote:
>AutoScroll = True ?
>
Dec 6 '06 #6

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

Similar topics

6
by: adrien | last post by:
Hi, (also posted in netscape.public.mozilla.browser) i use netscape 7 and want to hide the scrollbars of the window when something happens. I tried this: window.scrollbars.visible=false...
24
by: Nobody | last post by:
Okay, you are all so smart in here. Answer me this: IE6 in standards mode doesn't seem to hide scrollbars on the body element (overflow:hide) Ain't this a quandary. I have it in my head that I...
1
by: Fabrício de Novaes Kucinskis | last post by:
Hi all, I have to problems concerning datagrids, tabcontrols and scrollbars: 1) I created a form with a TabControl. This TabControl has two TabPages: the first with a datagrid to browse...
17
by: Dino M. Buljubasic | last post by:
I have a treeview and a checked list view controls one beside another. I want to make them work so that when I scroll down or up one of them the other does the same. Any help will be...
5
by: Christopher Kurtis Koeber | last post by:
Dear All, This may sound like an elementary question but how do you implement scrollbars for the Picturebox control. Do I have to create my own code to do this or is there some property that I can...
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...
2
by: MrNobody | last post by:
I have been struggling with .NET's scrollbars because when I use them I can't seem to get them to go to their maximum value. Searching on the web it looks like the maximum Value you can get on...
6
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I am implementing an Office 2007 – like interface, including the ability to change colors. One issue that I have is that scrollbars look poor if the application color theme (e.g., Black) does...
1
by: mrabie | last post by:
Hi All, I know this has been discussed before but i can't really find an answer to what i want to do. I am developing an application for touchscreen using C#. It's going to be a fullscreen...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.