473,657 Members | 2,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically set a ScrollBar based on form size

robkeithd
1 New Member
Greetings,

In a nutshell: I've got a panel sitting on a form that is docked to full sitting next to a vertical scrollbar that is docked left. There is a picture control sitting in the panel that may be larger than the viewable area of the panel. I'm trying to set the scrollbar up dynamically when the user resizes the form but it doesn't seem to take. For example: the user can see half of the image so the scrollbar maximum gets set to 2. When the value is 0 I set the picture top to zero so the user sees the top half and when the value is 1 I set the picture top such that the user sees the bottom half. Now the user resizes the form so only 1/4 of the image is visible. The scrollbar max is set to 4 but the scrollbar still only allows me to set the value to either 0 or 1 and not 0,1,2 or 3 as would expect. Am I missing some other property that needs to bet set or something? Any other ideas?

Thanks

Robert D
Sep 27 '08 #1
1 1501
tlhintoq
3,525 Recognized Expert Specialist
Create a method that fires on the form's SizeChanged event, that will recalculate your values.

SizeChanged fires every time DURING the changing of the form's size.
You might what to check if the mouse button is down in this method so you don't redraw/recalculate for ever 1 pixel change in size during the movement.

I *think* there is also a SizeChangeCompl ete event that happens just once when the user lets up on the mouse after size changing, but I'm not at my Dev computer to confirm that.
Sep 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2772
by: Alan | last post by:
I am trying to use javascript modal popup windows (window.createModalWindow) to display HTML forms. The problem is - the form size and content varies. The same entry form, under different circumstances can include different fields with different field-lengths. I am using a <TABLE> to place the fields on the form. My question is - how can I dynamically control the size of the popup and fit it to the size of the <TABLE> based on the...
4
13551
by: Rob T. | last post by:
I am using a div tag to make an element that contains some text. I have specified overflow: auto; in my stylesheet. If I use font-size/line-height to specify the font information I get a vertical scrollbar in firefox/netscape (not IE) , even though the text I have in the element does not exceed the bounds. The simple example below casues this behaviour. How do I fix this? <div style="overflow:auto; height:100px; width:100px;...
6
10930
by: Colin McGuire | last post by:
Hello experts, this is a repost but I have been (much) more clear. I want to know the position of the horizontal scrollbar in a textbox as a percentage - if the horizontal scrollbar is hard left, I want to display 0% on the form. - if the horizontal scrollbar is smack in the middle, I want to display 50% on the form. - if the horizontal scrollbar is 2/3rd along the X-axis,
22
2347
by: Colin McGuire | last post by:
I apologize for posting yet another scrollbar question. Here is my code. All I want is for a diagonal line to appear from coordinates (0,0) to (width,height) in a usercontrol regardless of whether the user autoscrolls the usercontrol (other things that are on the usercontrol I want to scroll, but haven't included any here). Here are the steps to reproduce my problem. 1. Launch Visual Studio and create a new Windows application with...
0
1031
by: Ron Dahl | last post by:
I have a form containing a panel and a picturebox inside the panel. The form load code changes the panel size to 400x400 and the picturebox size to 800x800 Autoscroll on the panel is set to true. The picturebox sizemode is set to AutoSize and StretchImage An image of size 400x400 is loadeded into the picturebox. Everything works as expected. I have also added the following code (see end of message). The pagedown does shift the visible...
1
2739
by: bubba ho-tep | last post by:
Hello, When you have a datalist repeating horizontally, is it possible to set the repeatcolumns dynamically based on the user's window size? EG. If the user's window is wide enough for 3 datalist items without the horizontal scrollbar appearing, then repeatcolumns=3. However, if the user's window is wide enough for 5 items without the horizontal scrollbar, then repeatcolumns=5. Thanks in advance for any wisdom dispensed.
1
6502
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to java class which creates a xml file based on values entered in dynamic jsp page. Now i want to read all those values entered to xml in my other jsp page. I am able to call values from file in my jsp page. But as dynamic values can be any in no...
0
4047
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to java class which creates a xml file based on values entered in dynamic jsp page. Now i want to read all those values entered to xml in my other jsp page.But as dynamic values can be any in no i don't know how could i populate all those in my jsp...
30
26496
ADezii
by: ADezii | last post by:
This week’s Tip of the Week will clearly demonstrate how you can dynamically set the Drop Down List Width of a Combo Box to the length of the longest item in its Row Source. The inspiration for this Tip came from one of our own resident Experts, mshmyob. In response to a Thread relating to this very Topic, mshmyob came up with a rather ingenious method to accomplish this task. He computed the Average Character Width of a String consisting of...
0
8420
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
8740
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
8516
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
8617
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
6176
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
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2743
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
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
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.