472,995 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,995 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 8806
* 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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.