473,395 Members | 2,467 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,395 software developers and data experts.

Need To Disable Horizontal Scrolling - Why Is HScroll Property Ignored?

I have a user control that needs to allow vertical scrolling but not
horizontal scrolling. In the user control's resize event, I need to
adjust the size of all the children controls. For this to work
correctly, I need the AutoScroll to not enable the horizontal
scrollbar.

After researching MSDN, I found the HScroll which can be used to
disable horizontal scrolling when the AutoScroll mode is enabled.
However, when I disable HScroll, it gets re-enabled again when my user
control is resized. I tried disabling at the beginning and front of
the resize event handler of the user control, but it still flips back.

Any ideas on how to get this to work?

May 9 '07 #1
3 5941
Just a shot in the dark--I haven't used HScroll--but what if you disable it
in the Paint event? After a resize, the control is invalidated and painted,
and it may be getting enabled sometime during the paint.

--
Brian Schwartz
FishNet Components
http://www.fishnetcomponents.com
Fish Grid .NET Light: Powerful Layouts for Small Datasets
"j0rd4n" <jo***********@gmail.comwrote in message
news:11*********************@n59g2000hsh.googlegro ups.com...
>I have a user control that needs to allow vertical scrolling but not
horizontal scrolling. In the user control's resize event, I need to
adjust the size of all the children controls. For this to work
correctly, I need the AutoScroll to not enable the horizontal
scrollbar.

After researching MSDN, I found the HScroll which can be used to
disable horizontal scrolling when the AutoScroll mode is enabled.
However, when I disable HScroll, it gets re-enabled again when my user
control is resized. I tried disabling at the beginning and front of
the resize event handler of the user control, but it still flips back.

Any ideas on how to get this to work?

May 9 '07 #2
Or, as Peter Duniho has pointed out, you might want to override OnPaint to
accomplish this, rather than attaching to the event, depending on your
situation.

--
Brian Schwartz
FishNet Components
http://www.fishnetcomponents.com
Fish Grid .NET Light: Powerful Layouts for Small Datasets
"Brian Schwartz" <ow***@fishnetcomponentswos.comwrote in message
news:e5**************@TK2MSFTNGP06.phx.gbl...
Just a shot in the dark--I haven't used HScroll--but what if you disable
it in the Paint event? After a resize, the control is invalidated and
painted, and it may be getting enabled sometime during the paint.

--
Brian Schwartz
FishNet Components
http://www.fishnetcomponents.com
Fish Grid .NET Light: Powerful Layouts for Small Datasets
"j0rd4n" <jo***********@gmail.comwrote in message
news:11*********************@n59g2000hsh.googlegro ups.com...
>>I have a user control that needs to allow vertical scrolling but not
horizontal scrolling. In the user control's resize event, I need to
adjust the size of all the children controls. For this to work
correctly, I need the AutoScroll to not enable the horizontal
scrollbar.

After researching MSDN, I found the HScroll which can be used to
disable horizontal scrolling when the AutoScroll mode is enabled.
However, when I disable HScroll, it gets re-enabled again when my user
control is resized. I tried disabling at the beginning and front of
the resize event handler of the user control, but it still flips back.

Any ideas on how to get this to work?


May 9 '07 #3
Unfortunately this didn't work quite like I had hoped. It worked in
some cases but not others. For instance, if the application starts up
maximized but the control needs scrollbars, and then it is restored to
its non-maximized size, the horizontal scrollbar appears.

Any other ideas? I tried using the Win32 ShowScrollBar method to
disable the horizontal scrollbar but this just hide it (didn't
actually affect the horizontal sizing of the form).

On May 9, 4:02 pm, "Brian Schwartz" <o...@fishnetcomponentswos.com>
wrote:
Just a shot in the dark--I haven't used HScroll--but what if you disable it
in the Paint event? After a resize, the control is invalidated and painted,
and it may be getting enabled sometime during the paint.

--
Brian Schwartz
FishNet Componentshttp://www.fishnetcomponents.com
Fish Grid .NET Light: Powerful Layouts for Small Datasets

"j0rd4n" <jordan.par...@gmail.comwrote in message

news:11*********************@n59g2000hsh.googlegro ups.com...
I have a user control that needs to allow vertical scrolling but not
horizontal scrolling. In the user control's resize event, I need to
adjust the size of all the children controls. For this to work
correctly, I need the AutoScroll to not enable the horizontal
scrollbar.
After researching MSDN, I found the HScroll which can be used to
disable horizontal scrolling when the AutoScroll mode is enabled.
However, when I disable HScroll, it gets re-enabled again when my user
control is resized. I tried disabling at the beginning and front of
the resize event handler of the user control, but it still flips back.
Any ideas on how to get this to work?

May 10 '07 #4

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

Similar topics

4
by: mr_burns | last post by:
Hi, Is it possible to disble horizontal scrolling using CSS? I want to try and use two backgrounds, one tiling vertically and part of the body background, which will not force scrolling, but one...
4
by: anna | last post by:
How to tell if a horizontal scrollbar is present? I only want to use scrollTo if horizontal scrollbar is present. window.scrollbars.visibility doesn't specify which scrollbar is present, so it...
14
by: Dave | last post by:
My web site is not particularly theme-based, but it contains an Art Gallery I'd like to display in a different perspective. I would like to horizontally scroll it, rather than vertically - as if...
0
by: Robert W. | last post by:
I've successfully implemented AutoScroll capability with one panel and it works great. But with another panel, when AutoScroll is turned on, an annoying & unnecessary horizational scrollbar...
2
by: Just D. | last post by:
Anybody knows how to disable the horizontal scrolling? Really do we have any official way for that? Just D.
1
by: RJN | last post by:
Hi I'm using an iFrame to enclose another document. The iFrame width is sufficient to hold the enclosed document. When the enclosed document has more data and exceeds the height set for iFrame,...
2
by: Eduard | last post by:
I have a ASP.Net datagrid wrap in the following div: <DIV id="divPart2" style="OVERFLOW: hidden">. Another div controls the horizontal scrolling: <DIV id="scroll1" style="OVERFLOW: scroll;...
3
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...
0
by: Assam | last post by:
I am developing a custom control which would act as a PDF viewer. I am extending this control from the Panel control(Please note i have enabled double buffering of controls). I am not using the auto...
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: 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: 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
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.