473,725 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5959
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******** *************@n 59g2000hsh.goog legroups.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***@fishnetc omponentswos.co mwrote in message
news:e5******** ******@TK2MSFTN GP06.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******** *************@n 59g2000hsh.goog legroups.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...@fishnetco mponentswos.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.fishnetcomp onents.com
Fish Grid .NET Light: Powerful Layouts for Small Datasets

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

news:11******** *************@n 59g2000hsh.goog legroups.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
19572
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 that will be part of a table stretching of to the right, which will force unwanted horizontal scrolling. How is this written in the stylesheet? Cheers Burnsy
4
3795
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 gives a false result if there is vertical scrollbar but not horizontal scrollbar. TIA, Anna
14
5415
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 the viewer is virtually "walking" through the gallery. I'm just attempting this to have this part of the page be different. Is horizontal scrolling okay, or will it throw our browsers into chaos and viewers into insanity? If horizontal scrolling...
0
2153
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 appears. I'd like to disable it but don't know how. I understand there to be an "HScroll" property but it's protected and I don't know how to get at it. Any ideas? --
2
1644
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
2876
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, both the scroll bars , horizontal and vertical appear. I want to avoid the horizontal scroll bar. If I set the scrolling property to "no", then both the scroll bars don't appear. I tried placing the iFrame tag inside div and setting the scrolling...
2
4227
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; WIDTH: 800px; LINE-HEIGHT: 0px; HEIGHT: 17px" onscroll="javascript: document.getElementById('divPart2').scrollLeft = this.scrollLeft;"> scrolls the datagrid horizontally. When the horizontal scroll box is dragged or any of the scrollbar arrows is
3
5394
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
1214
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 scroll property i.e. i am manually controlling the scrolling. The control works fine if there are no controls. But when there are controls in it then i have to change the poistion of the controls when the scroll bar value changes. The problem is...
0
8888
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
9401
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
9257
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
9174
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,...
0
9111
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6702
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
4782
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.