Hi,
I have a simple problem concerning the position of forms.
My windows form application has a main form and three instances of a
second form; BForm. It is not an MDI parent/child application and I've
set the StartPosition property for both forms to be Manual.
In the New method of the main form I create the 3 BForms and try to
position them below the main form (with the left sides aligned) using
the code below:
intPosX = 100 ' Same as the main form.
intPosY = Me.Top + Me.Height + (intBFormCounte r*BForm.Height)
BForm.Location = New Point(intPosX, intPosY)
Note intBFormCounter is a zero based counter of the number of instances
of the BForm.
The three identical forms are correctly aligned and stacked but the
first (uppermost) has its title bar hidden below the lower edge of the
main form. This behaviour remains the same if I change the position of
the main form.
I think that I am not correctly determining the height or lower edge
position of the main form.
Can anyone see what I've missed?
Thanks in advance,
Andy 3 1981
Hi,
You usually have to add a fudge factor when doing things like this.
Try adding 10 the y postion. Play around with it a little.
Ken
-----------------
"Andy" <an************ *********@gmail .com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. . Hi,
I have a simple problem concerning the position of forms.
My windows form application has a main form and three instances of a second form; BForm. It is not an MDI parent/child application and I've set the StartPosition property for both forms to be Manual.
In the New method of the main form I create the 3 BForms and try to position them below the main form (with the left sides aligned) using the code below:
intPosX = 100 ' Same as the main form. intPosY = Me.Top + Me.Height + (intBFormCounte r*BForm.Height) BForm.Location = New Point(intPosX, intPosY)
Note intBFormCounter is a zero based counter of the number of instances of the BForm.
The three identical forms are correctly aligned and stacked but the first (uppermost) has its title bar hidden below the lower edge of the main form. This behaviour remains the same if I change the position of the main form.
I think that I am not correctly determining the height or lower edge position of the main form.
Can anyone see what I've missed?
Thanks in advance,
Andy
Hi Ken,
Many thanks for the prompt response. A fudge factor of 19 worked for
me. I am a little surprised why this is necessary but I'm new to
VB.NET so perhaps its lack of experience ;)
Cheers,
Andy
You might look at the difference between the Form size and the
Form.ClientSize heights. Note the Clientsize is the size excluding the form
title bar and borders. You may need to add this offset
--
Dennis in Houston
"Andy" wrote: Hi,
I have a simple problem concerning the position of forms.
My windows form application has a main form and three instances of a second form; BForm. It is not an MDI parent/child application and I've set the StartPosition property for both forms to be Manual.
In the New method of the main form I create the 3 BForms and try to position them below the main form (with the left sides aligned) using the code below:
intPosX = 100 ' Same as the main form. intPosY = Me.Top + Me.Height + (intBFormCounte r*BForm.Height) BForm.Location = New Point(intPosX, intPosY)
Note intBFormCounter is a zero based counter of the number of instances of the BForm.
The three identical forms are correctly aligned and stacked but the first (uppermost) has its title bar hidden below the lower edge of the main form. This behaviour remains the same if I change the position of the main form.
I think that I am not correctly determining the height or lower edge position of the main form.
Can anyone see what I've missed?
Thanks in advance,
Andy
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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. However, there are images that I
used absolute positioning in order to place them in the appropriate
location on my page. When I do a browser resize,...
|
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:
http://www.wpdfd.com/editorial/wpd0103.htm#toptip (the second example)
The problem is, under the image is a large table. But using the above
positioning, now the...
|
by: Marek Mänd |
last post by:
xHTML 1.0 strict and valid css.
But though only IE shows up like I like it.
Not Opera7.50PR1, not Mozilla1.6.
Mozilla and Opera doesnt take interest in absolute positioning
herein this testcase (2800 B) at all:
http://www.hot.ee/idaliiga/bronn1test.htm
(MSIE screenshot http://www.hot.ee/idaliiga/bronn1test.gif)
|
by: hzgt9b |
last post by:
Using Visual studio 2003 and VB.NET, I want to programatically position a
control (windows media player) on my form. For example, I want to position
the control in 1 of 9 locations: topLeft, topCenter, topRIght, leftCenter,
center, rightCenter, bottomLeft, bottomCenter, bottomRight.
Is there an easy way to ask the container to place the...
|
by: Kathy Krizl |
last post by:
I have a form that I've added a "Find Record" button to. When the
button is clicked, I do a
DoCmd.RunCommand acCmdReplace
to get the standard Find and Replace dialog box to appear.
Is there a simple way I can position the box so that it comes up in
the bottom right hand corner of my form every time?
Thanks
| |
by: Joe Bonavita |
last post by:
My Web forms display differently on different machine with the same
resolution. The pages are designed to fit in 800*600 res but on some
machines with 800*600 the form appears too big.
Are there any built in functions to adjust the form based on resolution?
Is there a way to detect the clients resolution?
1 last one, when using an image,...
|
by: Luqman |
last post by:
I am newbie in ASP.Net, I just want to know, how can I drag and move the
controls from Toolbox to a Web Form, If I drag any object from Toolbar to
web form, it places on the 1st column, 1st row of the form, and when I try
to move that object to any other location of the Web Form, it does not move,
as we do in Visual Basic .Net, is it like that...
|
by: Hamed |
last post by:
Hello
I have a question about CHILD forms in an MDI form.
How can I have a neat positioning of child windows in an MDI form?
When I open a new child window in my MDI form it is opened in a new
cascading position but when I opens a lot of forms, it goes out of the
borders of the MDI form and a scroll bar appears in the MDI form.
|
by: Rich |
last post by:
Hello,
Is there a form property that can be set for positioning a form with respect
to the parent? I could have sworn I saw such a property like Center window,
or Parent something... But I don't see that property in a dialog form that I
want to use as a custom messagebox.
What is the best way to position a dialogresult form with respect...
|
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 src='photos/thumbs/
bigsmile.jpg'></a><a class='del' href='?p=gallery&del=2'>x</a></div>
where 'thumb' is my container, and 'del' should be aligned...
|
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...
| |
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. ...
|
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...
|
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...
|
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...
|
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...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |