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

scrollbar positionning in form

Sam
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
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(ByVal f As Form) As Integer
Get
Return GetScrollPos(CType(f.Handle, IntPtr), SB_VERT)
End Get
Set(ByVal Value As Integer)
SetScrollPos(CType(f.Handle, IntPtr), SB_VERT, Value, True)

End Set
End Property

Although the scrollbar is positionned correctely, the form however 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 #1
2 1209
"Sam" <sa**************@voila.fr> schrieb:
When I load my form my scrollbar is always positionned automatically at
the bottom for some reasons...


Take a look at the 'AutoScrollPosition' property.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
Sam
Thanks. However that is to auto-position the scrollbar on the control
that has the focus. What I'm doing is different as I position the
scrollbar manually but the form doesn't 'move'.

Can you help further ?

Nov 21 '05 #3

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

Similar topics

4
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...
1
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...
2
by: Marty | last post by:
Hi, When creating a form, how can we set its property .left and .top to be handled when the form is showed. Because, if I first assign values to ..left and .top, and secondly I call .show(),...
6
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...
22
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...
1
by: Sam | last post by:
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
4
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...
0
by: d.steininger | last post by:
Hi there! Is there a way to bind a Textbox.Text to a ScrollBar.Value (not the Textbox-own Scrollbar) and vice versa? The Problem: I have to deal with two controls. The Textbox should accept...
1
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...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.