473,988 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

positionning the scrollbar on a form

Sam
Hi,
When I load my form my scrollbar is always positionned automatically at
the bottom for some reasons... How can I force it to be always at the
top?

Thx

Nov 21 '05 #1
1 1018
Sam
I've actually user32.dll:

Private Const SB_VERT As Integer = 1

Private Declare Function GetScrollPos Lib "user32.dll " ( _
ByVal hWnd As IntPtr, _
ByVal nBar As Integer) As Integer

Private Declare Function SetScrollPos Lib "user32.dll " ( _
ByVal hWnd As IntPtr, _
ByVal nBar As Integer, _
ByVal nPos As Integer, _
ByVal bRedraw As Boolean) As Integer

Public Property VScrollPos(ByVa l f As Form) As Integer
Get
Return GetScrollPos(CT ype(f.Handle, IntPtr), SB_VERT)
End Get
Set(ByVal Value As Integer)
SetScrollPos(CT ype(f.Handle, IntPtr), SB_VERT, Value, True)
End Set
End Property

However, the scrollbar is positionned correctely but the form is not
refresh, so the form position doesn' t correspond to my scrollbar's.
I've tried a me.Refresh but it wouldn't do either...
Can you help?

Thx

Nov 21 '05 #2

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

Similar topics

4
16470
by: Paul T. RONG | last post by:
Dear all, Can one control the subform scrollbar through vba? For example, I would like to make two command buttons on the main form to control the subform scrollbar. Click 1st button the subform vertical scrollbar goes down to the end, click 2nd button goes up to the top position. Thank you for your help,
1
481
by: juli jul | last post by:
Hello, I have 4 controls on a form : chart (docked to top),scrollbar that supposed to be in the chart part of the form,than there is the splitter(docked to top) and than there is a grid(docked to fill). I want to dock the scrollbar that it would be located in the bottom of the chart(the upper part). How can I do it? Thank you very much.
6
10952
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
2383
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...
2
1233
by: Sam | last post by:
Hi, When I load my form my scrollbar is always positionned automatically at the bottom for some reasons... top? I've used user32.dll: Private Const SB_VERT As Integer = 1
4
4415
by: Price Brattin | last post by:
I dragged a datagrid onto a VB.Net WinForm and used the properties page and a few lines of code to set it up, including the DataSource. No wizard setup was used. It works fine except for one thing: there is no vertical scrollbar even there are more lines than can be shown on the datagrid. There is plenty room on the right for the scrollbar but it is not there. If there is a scrollbar property for the .Net datagrid like in the VB6 DBgrid,...
1
1526
robkeithd
by: robkeithd | last post by:
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. ...
1
2920
by: =?Utf-8?B?UmljaA==?= | last post by:
I placed a button on a form menustrip for the purpose of causing the horizontal scrollbar of my form to appear so that I can access controls outside of the form's current view (the controls are further to the right of the form than the form's default width - which may take up the entire screen for some users). The form contains panels which will contain either textboxes or datagridviews. The button is located on the menustrip towards...
8
2189
by: ahilar12 | last post by:
Hi experts, I have a form with many textboxes,listboxes in php.I have a edit button to edit the values in the form.once i click the edit button the existing values should be displayed so that the user can edit those particular values and also that should be updated in the mysql database.kindly reply me as early as possible. Thanks
0
10400
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
10225
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10982
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
8533
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
6492
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...
0
6655
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5239
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
4821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3822
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.