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

Win Forms Positioning

I need to position a normal form at a certain position above another
form....mainly I would like it to have
a left of 0 (far left) and its top to start just below my toolbar.

Other than using GetSystemMetrics API to determine height of menu and win
caption, I have no idea how to do this.

Any ideas? Or is that the only way?

thanks,

Shane
Nov 21 '05 #1
1 834
Hi,

You can use the setwindowpos function. Use the hwnd_topmost
flag to make window a topmost window.

Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal
hwnd As Integer, _
ByVal hWndInsertAfter As Integer, ByVal x As IntPtr, ByVal y As
Integer, _
ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
As Integer

Const HWND_TOPMOST As Integer = -1
Const SWP_NOMOVE As Integer = &H2
Const SWP_NOSIZE As Integer= &H1

SetWindowPos(Me.Handle.ToInt32, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE +
SWP_NOSIZE)
Ken
------------------------
"Shane Story" <no****@nothanks.com> wrote in message
news:uj**************@tk2msftngp13.phx.gbl...
I need to position a normal form at a certain position above another
form....mainly I would like it to have
a left of 0 (far left) and its top to start just below my toolbar.

Other than using GetSystemMetrics API to determine height of menu and win
caption, I have no idea how to do this.

Any ideas? Or is that the only way?

thanks,

Shane

Nov 21 '05 #2

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

Similar topics

9
by: Bryan R. Meyer | last post by:
Hello Everyone, The problem of browser resizing has become an issue for me. While redesigning my webpage, I set the left and right margins to be auto so that my content would be centered. ...
39
by: Zak McGregor | last post by:
Hi all Are there any good solutions to aligning form field names and input boxes without resorting to tables? I am struggling to do this nicely at the moment. Thanks Ciao Zak
4
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here:...
14
by: Harlan Messinger | last post by:
What am I not understanding about the definition of { position: absolute; }? "The box's position (and possibly size) is specified with the 'left', 'right', 'top', and 'bottom' properties. These...
1
by: Charles Harrison Caudill | last post by:
with tables there is a clean and algorithmic way to organize things, but with css which is, once you get it working, much cleaner, I have to tweak and patch and hope and pray and curse before...
6
by: salmobytes | last post by:
After a javascript-generated post event (this is a post, not ajax messaging) the current screen has to be redrawn. But on *long forms* (longer than a single screen) then the current screen...
2
by: jgarrard | last post by:
I have a simple form. I am trying to be good and allow for both font sizing, and fluid layout. What I want is for the input boxes to align horizontally next to the labels, but to jump down to...
6
by: Mark | last post by:
hi, i'm trying to position something in the top right corner of a container, but i can't seem to figure out how to get it working. here's the html <div class='thumb'><a href='image.jpg'><img...
5
vdraceil
by: vdraceil | last post by:
My form layout window(vb6.0) doesnt show any forms in it,but i want to position my forms..is there any settings i should change?or is there any alternative to position my forms(by coding)?
1
geolemon
by: geolemon | last post by:
I have several forms that I've built... Most of them have some sort of VBA code built in somewhere, like: Select a record with the key-value control, and the rest of the controls position to that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
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.