473,739 Members | 7,912 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting MDI Child Form location programatically

Tom
I want to be able to 'make' a MDI Child Window appear at the same place in
my MDI container. For example, maybe I want this Child window to always
appear at Top=0 and Left=0; or, when the user exits my Child window, I save
the last location for that window, and then when the reopen the window I
want to restore the location they were at previously.

In my Load event, I set the .Top and .Left properties for my child window;
however, when it shows in my MDI container it is always positioned
automatically (cascaded) and NOT positioned at the place I told it too. How
can I make it appear at the location I want it to within the MDI container?

Thanks.

Tom
Nov 20 '05 #1
4 15133
when you open your child....
Dim f As New Form1

f.StartPosition = FormStartPositi on.Manual 'here's the key

f.Left = 0

f.Top = 0

f.MdiParent = Me

f.Show()

"Tom" <to*@nospam.com > wrote in message
news:OY******** ******@TK2MSFTN GP10.phx.gbl...
I want to be able to 'make' a MDI Child Window appear at the same place in
my MDI container. For example, maybe I want this Child window to always
appear at Top=0 and Left=0; or, when the user exits my Child window, I save the last location for that window, and then when the reopen the window I
want to restore the location they were at previously.

In my Load event, I set the .Top and .Left properties for my child window;
however, when it shows in my MDI container it is always positioned
automatically (cascaded) and NOT positioned at the place I told it too. How can I make it appear at the location I want it to within the MDI container?
Thanks.

Tom

Nov 20 '05 #2
when you open your child....
Dim f As New Form1

f.StartPosition = FormStartPositi on.Manual 'here's the key

f.Left = 0

f.Top = 0

f.MdiParent = Me

f.Show()

"Tom" <to*@nospam.com > wrote in message
news:OY******** ******@TK2MSFTN GP10.phx.gbl...
I want to be able to 'make' a MDI Child Window appear at the same place in
my MDI container. For example, maybe I want this Child window to always
appear at Top=0 and Left=0; or, when the user exits my Child window, I save the last location for that window, and then when the reopen the window I
want to restore the location they were at previously.

In my Load event, I set the .Top and .Left properties for my child window;
however, when it shows in my MDI container it is always positioned
automatically (cascaded) and NOT positioned at the place I told it too. How can I make it appear at the location I want it to within the MDI container?
Thanks.

Tom

Nov 20 '05 #3
Tom
Ah, .Manual was the key. That fixed it. Thanks!

Tom

"SStory" <Th*******@TAKE OUTTHISSPAMBUST ERsofthome.net> wrote in message
news:eY******** ******@TK2MSFTN GP09.phx.gbl...
when you open your child....
Dim f As New Form1

f.StartPosition = FormStartPositi on.Manual 'here's the key

f.Left = 0

f.Top = 0

f.MdiParent = Me

f.Show()

"Tom" <to*@nospam.com > wrote in message
news:OY******** ******@TK2MSFTN GP10.phx.gbl...
I want to be able to 'make' a MDI Child Window appear at the same place in my MDI container. For example, maybe I want this Child window to always
appear at Top=0 and Left=0; or, when the user exits my Child window, I

save
the last location for that window, and then when the reopen the window I
want to restore the location they were at previously.

In my Load event, I set the .Top and .Left properties for my child window; however, when it shows in my MDI container it is always positioned
automatically (cascaded) and NOT positioned at the place I told it too.

How
can I make it appear at the location I want it to within the MDI

container?

Thanks.

Tom


Nov 20 '05 #4
you're welcome
"Tom" <to*@nospam.com > wrote in message
news:en******** ******@TK2MSFTN GP10.phx.gbl...
Ah, .Manual was the key. That fixed it. Thanks!

Tom

"SStory" <Th*******@TAKE OUTTHISSPAMBUST ERsofthome.net> wrote in message
news:eY******** ******@TK2MSFTN GP09.phx.gbl...
when you open your child....
Dim f As New Form1

f.StartPosition = FormStartPositi on.Manual 'here's the key

f.Left = 0

f.Top = 0

f.MdiParent = Me

f.Show()

"Tom" <to*@nospam.com > wrote in message
news:OY******** ******@TK2MSFTN GP10.phx.gbl...
I want to be able to 'make' a MDI Child Window appear at the same place
in
my MDI container. For example, maybe I want this Child window to
always appear at Top=0 and Left=0; or, when the user exits my Child window, I

save
the last location for that window, and then when the reopen the window I want to restore the location they were at previously.

In my Load event, I set the .Top and .Left properties for my child window; however, when it shows in my MDI container it is always positioned
automatically (cascaded) and NOT positioned at the place I told it

too. How
can I make it appear at the location I want it to within the MDI

container?

Thanks.

Tom



Nov 20 '05 #5

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

Similar topics

2
1251
by: Peter Oliphant | last post by:
I've tried to set up a Form location via its constructor in the following way (My_Form is derived as a child of the standard Form): My_Form( int x, int y, int w, int h ) { Rectangle rect( x, y, w, h ) ; this->Bounds = rect ; } ; When I do this the width and height are properly set, but it doesn't place
3
3209
by: Lance | last post by:
I've noticed that controls that are contained in MDI child forms fail to raise MouseLeave events if the MDI child form's MdiParent property is set to Nothing (after it was set to an existing MDI container form) or if the MDI child form's Visible property is set to False (after the MDI child form was shown). This is an enormous problem for my app because I must show different MDI child forms based on the state of my application and many of the...
10
4026
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
0
4491
by: Henry Wu | last post by:
Hi, I am aware that TransparencyKey only works with top-level forms or Non-MDI Child Forms, if one tries to set the opacity or transparencykey property to a MDI-Child form, it will have no effect. So, I tricked my Transparent Non-MDI Child form into my MDI-Container form via SetParent API as seen here in my VB.NET sample ( http://wuhenry.beigetower.org/position.zip ). I thought my problems are over, but apprently, even though I...
0
314
by: Tom | last post by:
I want to be able to 'make' a MDI Child Window appear at the same place in my MDI container. For example, maybe I want this Child window to always appear at Top=0 and Left=0; or, when the user exits my Child window, I save the last location for that window, and then when the reopen the window I want to restore the location they were at previously. In my Load event, I set the .Top and .Left properties for my child window; however, when it...
3
4737
by: Zack Sessions | last post by:
I am using VB.NET 2003. I have read the threads concerning the problem where the FormStartPosition of CenterParent is ignored if the form is displayed with the Show method as opposed to the ShowDialog method. I am having a similar problem and I found a thread that had the following code in the child form's Load event: Me.Location = New Point(( _ Me.MdiParent.ClientSize.Width - Me.Width) * 0.5,
2
2160
by: Lenster | last post by:
Environment --------------- Visual Studio.NET 2003 Version 7.1.3088 ..NET Framework 1.1 Version 1.1.4322 SP1 XP Professional 5.1.2600 SP2 Build 2600 Problem Description ----------------------- I have an mdi parent form.
5
4459
by: vul | last post by:
I have an MDI application with a ListBar on the left side of MDI form. All child forms are displayed inside of the client area of MDI form. Now I need to display a third form from a child and center it related to the calling Child form. I cannot find the way to do that. Any help please Al
8
7838
by: Studlyami | last post by:
I have form1 and form2. I want form2 to be a child of form1 so that when i set its location it will be drawn in relation to its parent. EX: Form2Object.Location = new point (0,0) would put form2 at the top left corner of form one. I set the MDI property to true for form one. My Created my form2 like so: Form2 Form2Object = new Form2(); Form2Object.Parent = this; //causes error see below
0
9479
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
9337
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
9266
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
9209
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...
0
8215
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
6054
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
4570
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
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2193
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.