|
-
Jan 8th, 2009, 11:37 AM
#1
Thread Starter
Lively Member
MDI forms location/Class-function
Hello, I want to create a function (class?) that will have stored the coordinates(values) of my mdiforms, so I can call it whenever I want to dispaly the mdiforms. I want to avoid retyping again and again (in every mdi form) the above code: Me.Top=5
Me.Left=150
on forms load.
Any suggestions?
-
Jan 8th, 2009, 11:44 AM
#2
Re: MDI forms location/Class-function
Add a form to your project and name it MdiChildForm. Set its StartPosition property to Manual and its Location to 150, 5. That class is now the base for all your task-specific child forms. You may need to build before you can select it as a base class.
When you want to add a new child form to your project, right-click in the Solution Explorer and select Add Windows Form as you usually do but, instead of just entering the name and clicking OK, change the item template select from Windows Form to Inherited Windows Form. When you click OK you will be asked to select a base class. This is where you select the MdiChildForm class that you created earlier.
Having said all that, are you going to be displaying multiple child forms simultaneously? If so, do you really want them to be displayed at the same location?
-
Jan 8th, 2009, 12:05 PM
#3
Thread Starter
Lively Member
Re: MDI forms location/Class-function
thanks for replying..I did what you told me.Yes this is one of the solution... I just wanted to understand how I can write code to do this.
Yes I know that it is not very logical to open all the mdiforms in the same location...but I wanted to test it like this.
Thanks for replying
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|