First Main Form quick question.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Miro

    First Main Form quick question.

    Without using this:
    For Each currentForm As Form In My.Application. OpenForms

    or using something like me.mdi parent

    how can i reference the main form's form variable.

    Example:
    If i open another form I can say:
    dim bla as new frmForm2

    i can now do bla.windowstate = blajsdfkljdslkj f

    how can I ( in a submost form that is like 3 windows deep say somethign
    like )

    frmMainForm.min imize

    its the frmMainForm variable I am having trouble with - since I dont
    actaully define the first variable i dont have a reference to it.

    I suppose I can make a public variable and when the main window opens put
    the mainform's reference into it, but wondering if vb.net already has an
    internal variable that holds the 'first' main form.

    Thanks,

    Miro

  • James Hahn

    #2
    Re: First Main Form quick question.

    There is a good description of this issue here:
    PGBET merupakan sebuah situs game online dengan sejuta permainan seru dan menarik. Unduh APK game untuk mendapatkan promosi terbaru dan tips trik tergacor hari ini.


    But more recently, see this:


    Basically, the type name can be used to access a default instance.

    "Miro" <miro@beero.com wrote in message
    news:O5%23jZsdR JHA.4524@TK2MSF TNGP06.phx.gbl. ..
    Without using this:
    For Each currentForm As Form In My.Application. OpenForms
    >
    or using something like me.mdi parent
    >
    how can i reference the main form's form variable.
    >
    Example:
    If i open another form I can say:
    dim bla as new frmForm2
    >
    i can now do bla.windowstate = blajsdfkljdslkj f
    >
    how can I ( in a submost form that is like 3 windows deep say somethign
    like )
    >
    frmMainForm.min imize
    >
    its the frmMainForm variable I am having trouble with - since I dont
    actaully define the first variable i dont have a reference to it.
    >
    I suppose I can make a public variable and when the main window opens put
    the mainform's reference into it, but wondering if vb.net already has an
    internal variable that holds the 'first' main form.
    >
    Thanks,
    >
    Miro

    Comment

    • Miro

      #3
      Re: First Main Form quick question.

      Thank you James,

      Thats exactly what I ended up doing, in the end.

      However this article was helpful as I created a public module and not a
      friend module.

      Thank you,

      Miro

      "James Hahn" <jhahn@yahoo.co mwrote in message
      news:uKkjmQeRJH A.4992@TK2MSFTN GP05.phx.gbl...
      There is a good description of this issue here:
      PGBET merupakan sebuah situs game online dengan sejuta permainan seru dan menarik. Unduh APK game untuk mendapatkan promosi terbaru dan tips trik tergacor hari ini.

      >
      But more recently, see this:

      >
      Basically, the type name can be used to access a default instance.
      >
      "Miro" <miro@beero.com wrote in message
      news:O5%23jZsdR JHA.4524@TK2MSF TNGP06.phx.gbl. ..
      >Without using this:
      >For Each currentForm As Form In My.Application. OpenForms
      >>
      >or using something like me.mdi parent
      >>
      >how can i reference the main form's form variable.
      >>
      >Example:
      >If i open another form I can say:
      >dim bla as new frmForm2
      >>
      >i can now do bla.windowstate = blajsdfkljdslkj f
      >>
      >how can I ( in a submost form that is like 3 windows deep say somethign
      >like )
      >>
      >frmMainForm.mi nimize
      >>
      >its the frmMainForm variable I am having trouble with - since I dont
      >actaully define the first variable i dont have a reference to it.
      >>
      >I suppose I can make a public variable and when the main window opens put
      >the mainform's reference into it, but wondering if vb.net already has an
      >internal variable that holds the 'first' main form.
      >>
      >Thanks,
      >>
      >Miro
      >

      Comment

      Working...