Results 1 to 3 of 3

Thread: MDI forms location/Class-function

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    92

    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?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    92

    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
  •  



Click Here to Expand Forum to Full Width