473,836 Members | 1,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(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

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 1224
"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 'AutoScrollPosi tion' 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
16451
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.
2
4826
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(), then the form does not display at the correct screen location. ex: System.windows.forms.form myForm = new System.windows.forms.form(); myForm.left = 200;
6
10941
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
2367
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...
1
1013
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
4406
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,...
0
2631
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 integers as input, limited by a ScrollBar's Minimum- and Maximum. Changing the ScrollBar-Value should update the Textbox-Text and vice versa. So the textbox-text and scrollbar-value represent the same value. The user is
1
1521
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. ...
0
10838
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
10544
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
10585
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
9369
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6977
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
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
4447
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
4010
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3111
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.