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

CenterParent not working

I have the windows startup position on a child form to centerParent.

The calling code to the form is:

Dim objBackground As New frmBackground

objBackground.MdiParent = Me
'objBackground.Width = Me.ClientSize.Width * 0.97
'objBackground.Height = Me.ClientSize.Height * 0.92
objBackground.Width = Me.ClientSize.Width * 0.9
objBackground.Height = Me.ClientSize.Height * 0.9
objBackground.StartPosition = FormStartPosition.CenterParent
objBackground.Show()
End Sub

Any ideas on why my form is loading towards the top left of the corner
instead of centered on the parent mdi container?

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
9 8826
* Ivan Weiss <iv*****@optonline.net> scripsit:
I have the windows startup position on a child form to centerParent.

The calling code to the form is:

Dim objBackground As New frmBackground

objBackground.MdiParent = Me
'objBackground.Width = Me.ClientSize.Width * 0.97
'objBackground.Height = Me.ClientSize.Height * 0.92
objBackground.Width = Me.ClientSize.Width * 0.9
objBackground.Height = Me.ClientSize.Height * 0.9
objBackground.StartPosition = FormStartPosition.CenterParent
objBackground.Show()
End Sub

Any ideas on why my form is loading towards the top left of the corner
instead of centered on the parent mdi container?


This is "by design" for MDI children.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
So there is no way to center a form within an MDI client area? Am I
better off to just setting it to center screen? I don't understand why
this wouldn't be a functional option considering it is provided.

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3
it's provided mainly for modal dialog boxes, not child forms in MDI... MDI
limits a lot of functionality, that is why people are generally createing
SDI applications now
"Ivan Weiss" <iv*****@optonline.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
So there is no way to center a form within an MDI client area? Am I
better off to just setting it to center screen? I don't understand why
this wouldn't be a functional option considering it is provided.

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #4
If SDI seems to be the way most apps are being designed now than why do
major apps for example most Microsoft products, accounting software
packages, email programs, etc... use MDI interfaces. Are there any
examples of nice SDI interfaces cause in my personal experience they
always seem like "cheaper" less professional type of apps if you know
what I mean.

I am open to going with an SDI implementation but I thought MDI was more
appealing to the eye.

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5
microsoft actaully uses SDI now for a lot of apps... they have been
switching over a lot, MS word is now SDI for example
"Ivan Weiss" <iv*****@optonline.net> wrote in message
news:ua**************@tk2msftngp13.phx.gbl...
If SDI seems to be the way most apps are being designed now than why do
major apps for example most Microsoft products, accounting software
packages, email programs, etc... use MDI interfaces. Are there any
examples of nice SDI interfaces cause in my personal experience they
always seem like "cheaper" less professional type of apps if you know
what I mean.

I am open to going with an SDI implementation but I thought MDI was more
appealing to the eye.

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #6
I think that you might be getting a little confused with Parent, Child,
MDIParent and MDIChild forms. Parent and MDIParent forms are not the same
thing nor are Child and MDIChild forms the same thing. It is very easy to
forget this because the differences are quite subtle.

When you open an MDIChild form, you set it's MDIParent property rather than
it's Parent property. This logocally renders the
FormStartPosition.CenterParent value for StartPosition redundant. Unless you
have a specific need, you should set the StartPosition for an MDIChild form
to FormStartPosition.DefaultBounds. This causes MDIChild forms to be opened
'cascaded' within the confines of the MDIClient area of the MDIParent form.

"Ivan Weiss" <iv*****@optonline.net> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
I have the windows startup position on a child form to centerParent.

The calling code to the form is:

Dim objBackground As New frmBackground

objBackground.MdiParent = Me
'objBackground.Width = Me.ClientSize.Width * 0.97
'objBackground.Height = Me.ClientSize.Height * 0.92
objBackground.Width = Me.ClientSize.Width * 0.9
objBackground.Height = Me.ClientSize.Height * 0.9
objBackground.StartPosition = FormStartPosition.CenterParent
objBackground.Show()
End Sub

Any ideas on why my form is loading towards the top left of the corner
instead of centered on the parent mdi container?

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #7
* Ivan Weiss <iv*****@optonline.net> scripsit:
If SDI seems to be the way most apps are being designed now than why do
major apps for example most Microsoft products, accounting software
packages, email programs, etc... use MDI interfaces. Are there any
examples of nice SDI interfaces cause in my personal experience they
always seem like "cheaper" less professional type of apps if you know
what I mean.
If you have a closer look, most new MSFT applications do not use real
MDI any more.
I am open to going with an SDI implementation but I thought MDI was more
appealing to the eye.


I liked MDI too, but it will die...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
"Brian Henry" <[REMOVE-ME]br******@adelphia.net> schrieb
it's provided mainly for modal dialog boxes, not child forms in
MDI... MDI limits a lot of functionality, that is why people are
generally createing SDI applications now


I hate SDI applications. Apart from the one-Form tools (that have been
put into an MDI window meanwhile), all my applications are MDI apps
because they are much easier to handle (IMO). The first thing I did
after installing Access 2000 was switch back to the MDI
style because I have everything in one place - and I wanted to be able
to Alt+Tab through apps not through windows. I think the things that Ivan
tries (including the always-maximized child thing) are not really necessary
for the most applications or can be done manually. Of course these are
personal preferences only.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #9
Thank you everyone for your feedback. I think what is really the center
issue here for me is I am developing an app that down the road I want to
incorporate an enormous amount of features. And having the SDI
structure for me would mean a lot of small forms opening on top of each
other which is essentially to me like keeping a messy stack of papers on
your desk. I always viewed the MDI structure, to follow my example, as
a way of keeping the stack of a papers in a bin so it stays neat. If
the user wants to minimize my program they just hit one minimize button,
not one for every window they have open. That is why I do not see why
the SDI structure would be better at this point. Most of my forms are
quite small and will not take up the entire screen (they are wide but
not high) so I just think keeping them in the mdi child area is a nicer
presentation and lets me keep them together. In Word there is only one
window open at a time so I guess the SDI works well but my app is
comprised of a lot of different forms and the user will be switching
between these often.

Am I going on the right path, based on this does MDI still sound correct
or am I missing something with the SDI structure?

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #10

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

Similar topics

0
by: C-Sharper or C-Hasher, one of the two | last post by:
Hi Guys and Gals, I have a small, two form, application. Form1 is the main window and Form2 is a small window that has a label and a progress bar on it. I wish to display form2 whilst doing some...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
1
by: gewe | last post by:
I have a form (sizeable border, shows in taskbar, nothing unusual), which is the main form of my application (called MainForm). During an operation progress is shown in another form, that is shown...
2
by: Phillip Ross Taylor | last post by:
I have configured a few of the windows I am working on to have the form value "Start Position" to be "CenterParent" but some of them don't. Does Center Parent only work when the dialog is modal?...
4
by: > Adrian | last post by:
I have "CenterParent" in the Properties and in the form location in the application, and still the form that is called does not get positionned center parent. Parent = this; produces errors. How do...
2
by: _dee | last post by:
Not a critical problem, just annoying: Normally I use : this.StartPosition = FormStartPosition.CenterParent; in the constructor of a dialog to make sure it doesn't show up in the corner of the...
6
by: Eric B. | last post by:
I posted about this before but it is still bugging me. I am creating an instance of form2 from my form1, and although I have the StartPosition set to CenterParent for the form2 it is not...
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?
0
marktang
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,...
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...
0
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...
0
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,...
0
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...

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.