Results 1 to 7 of 7

Thread: how do i create a form inside a nother form

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    56

    how do i create a form inside a nother form

    Hey guys.

    Im trying to code a form

    that when i press a button it will create another forum automatic.
    and will also create a process on it.

    any 1 got any help with this im trying and i carnt seem 2 get it.
    my questions will be in vb6 or visual studios 2005

  2. #2
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: how do i create a form inside a nother form

    SwInY:

    I don't think you do create a form in a form or at least not without a lot of work.

    Why not just add a form to your project? Project Menu>Add Form.

    Then you can write whatever code you want to work with the second form.
    All you would do is to open form2 when someone clicks on the button on form1.

    You could also position the second form so it would hide all or part of the first form or appear beside it or whatever.

    Not sure if that is what you want, but it should work

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    56

    Re: how do i create a form inside a nother form

    because i want to be able to like.
    im going to start to make a hlds server watcher.

    it will be watching more than 1 server
    so i want to have a add a server button that will creat a nother form.

    or could i possibly be able 2 write a code in the 1 thing
    that will just create more process thingys.

    will this affect this also i want to creat like 10 processers with like same hlds.exe
    and then watch em will it be hard 2 watch that 1 process?
    my questions will be in vb6 or visual studios 2005

  4. #4
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: how do i create a form inside a nother form

    SwInY:

    OK. Well, I still think you can do it as I suggested.
    my questions will be in vb6 or visual studios 2005
    The way I stated above is for VB6, but VB.Net would be almost the same.
    Click Project on the menu bar then Add Windows Form.
    Then, it depends on how you want the xecond form to appear.
    If you want the second form to hide the first form then just give both forms the same Top/Left postion setting.
    If you first form is larger and you want the second form to just appear on the first form then you will have to set the Top/Left positons accordingly.
    Then in the click event of the button on your first form you would call the second form. Any code you want to execute on the second form could be in the second form's load event.
    That should work, although I don't know anything about
    a hlds server watcher

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    56

    Re: how do i create a form inside a nother form

    i dont know how many forms the client will want tho?.
    and i dont feel like creating 100 forms 2 be sure?.

    and they might want all the servers running at 1nce
    which means like 100 forms can be made running at 1nce?
    my questions will be in vb6 or visual studios 2005

  6. #6
    Lively Member mowafy's Avatar
    Join Date
    Jul 2005
    Posts
    116

    Re: how do i create a form inside a nother form

    hi
    you can use code like this
    VB Code:
    1. Form2.TopLevel = False
    2.         form1.Controls.Add(Form2)
    3.         Form2.Dock = DockStyle.Fill

  7. #7
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: how do i create a form inside a nother form

    Are you sure this is the best way to do this??

    It seems a little pointless creating 100 forms or however many you need. Would it not be better to have some system where they enter in a server or select it from a list for example and the information is loaded into the controls on 1 form.

    They will only ever be able to look at a some information at a time anyway so you may as well keep it simple. Perhaps have some data grid that contains the essential information and can be updated as and when needed.

    Just a suggestion.
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

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