Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2007

Tip: Looking for answers? Try searching our database.

centering a childform in MDI parent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peted - 23 Aug 2007 04:39 GMT
I have a simple c# app that opens a child form in a mdi parent.

I want the child form to open in the center of the mdi parent, so i
can open the child form ok, it all works fine, but setting

           frmConfig = new ConfigForm(this);
           frmConfig.MdiParent = this;
          frmConfig.TopLevel = false;

          frmConfig.StartPosition = FormStartPosition.CenterParent;
           frmConfig.Show();

does not seem to work regardless if i set it runtime or in the windows
properties  at design time.

The only way i can get CenterParent to work is to display the form
using Showdialog(), but then it has to be top level and the user can
drag it out the bounds of the MDI parent.

What i have found is if i use

frmConfig.StartPosition = FormStartPosition.CenterScreen;
       

this will display the childform in the center of the parent, seemingly
regardless of where the parent is located on screen.

All the internet examples ive found say to use
FormStartPosition.CenterParent;

Does anyone have any idea whats going on and how it should be done ?

Peted
andy - 23 Aug 2007 04:40 GMT
I will try it
if you can save your some time,pls help me solvet my problem:
===
how to know some fields were  modified by user?
dear all,
    how to know some fields were  modified by user?
list bellow my project:
components: DataGridView,DataSet
when user change the DataGridView colmons field value,we can use
Dataset.Getchanges.tables[0] to list current record was modified.
but I can't know which fields were edited,only know the user edit the row.
even though I can't know it if a new record or edited record.
thanks all!!!
andy
2007-08-23

===
<Peted> ???????:kbvpc35ig024pacb89j4emiokjrfodgirk@4ax.com...
>I have a simple c# app that opens a child form in a mdi parent.
>
[quoted text clipped - 28 lines]
>
> Peted
kishor - 23 Aug 2007 06:44 GMT
Hey andy.....

There are many thirdparty components are available.... check for dirtybit
cheker.

Regards,
Kishor

> I will try it
> if you can save your some time,pls help me solvet my problem:
[quoted text clipped - 46 lines]
> >
> > Peted
kishor - 23 Aug 2007 06:42 GMT
Hi,
I also have faced same problem long back...
I am just giving you hint ... not a solution

Put frmConfig.StartPosition = FormStartPosition.CenterParent;
statement immidetely after   frmConfig = new ConfigForm(this);

and put CenterParent in design time also.

Kishor

> I have a simple c# app that opens a child form in a mdi parent.
>
[quoted text clipped - 29 lines]
>
> Peted
Peted - 23 Aug 2007 09:26 GMT
Hi Sorry but that does not make any difference.

Placing the statements in a different order makes no change, it still
cause the child form to appear upper to the left

the only thing that works is to use

FormStartPosition.CenterScreen;  to center in a mdi form

is this normal ?

does any one know why this is please ?

thanks

>Hi,
>I also have faced same problem long back...
[quoted text clipped - 40 lines]
>>
>> Peted

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.