Enable application framework

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

    #1

    Enable application framework

    In a new WindowsForm project with default settings I wrote a loop:
    For Each frm In My.Application. OpenForms

    If frm.Name <"MDIMain" Then

    frm.Close()

    End If

    Next

    Everything was fine until I decided to use Sub Main as Startup object. In
    order to have it in the list of startup objects I had to uncheck Enable
    application framework. Since that I have My.Application. OpenForms
    highlighted and IDE says 'OpenForms is not a member of
    'CMS.My.MyAppli cation'

    How can I have OpenForms collection in my project if I use Sub Main as
    Startup object?

    Thank you

    vovan


  • Sachin Palewar

    #2
    Re: Enable application framework

    If you are using VS 2005 you can try looping through
    MDIForm.MdiChil dren, instead of application.ope nforms.

    Regards,

    Sachin Palewar
    (Certified Scrum Master)

    Palewar Techno Solutions
    (Mobile Solutions for Your Business)




    On Mar 30, 11:56 pm, "vovan" <some...@vovan. comwrote:
    In a new WindowsForm project with default settings I wrote a loop:
    For Each frm In My.Application. OpenForms
    >
    If frm.Name <"MDIMain" Then
    >
    frm.Close()
    >
    End If
    >
    Next
    >
    Everything was fine until I decided to use Sub Main as Startup object. In
    order to have it in the list of startup objects I had to uncheck Enable
    application framework. Since that I have My.Application. OpenForms
    highlighted and IDE says 'OpenForms is not a member of
    'CMS.My.MyAppli cation'
    >
    How can I have OpenForms collection in my project if I use Sub Main as
    Startup object?
    >
    Thank you
    >
    vovan

    Comment

    • vovan

      #3
      Re: Enable application framework

      I found the solution. It should be:
      System.Windows. Forms.Applicati on.OpenForms

      vovan

      "vovan" <someone@vovan. comwrote in message
      news:ukaAITvcHH A.2316@TK2MSFTN GP04.phx.gbl...
      In a new WindowsForm project with default settings I wrote a loop:
      For Each frm In My.Application. OpenForms
      >
      If frm.Name <"MDIMain" Then
      >
      frm.Close()
      >
      End If
      >
      Next
      >
      Everything was fine until I decided to use Sub Main as Startup object. In
      order to have it in the list of startup objects I had to uncheck Enable
      application framework. Since that I have My.Application. OpenForms
      highlighted and IDE says 'OpenForms is not a member of
      'CMS.My.MyAppli cation'
      >
      How can I have OpenForms collection in my project if I use Sub Main as
      Startup object?
      >
      Thank you
      >
      vovan
      >
      >

      Comment

      • vovan

        #4
        Re: Enable application framework

        Thanks a lot for your good advice

        vovan

        "Sachin Palewar" <palewar@gmail. comwrote in message
        news:1175279104 .143595.22410@b 75g2000hsg.goog legroups.com...
        If you are using VS 2005 you can try looping through
        MDIForm.MdiChil dren, instead of application.ope nforms.
        >
        Regards,
        >
        Sachin Palewar
        (Certified Scrum Master)
        >
        Palewar Techno Solutions
        (Mobile Solutions for Your Business)

        >
        >
        >
        On Mar 30, 11:56 pm, "vovan" <some...@vovan. comwrote:
        >In a new WindowsForm project with default settings I wrote a loop:
        >For Each frm In My.Application. OpenForms
        >>
        > If frm.Name <"MDIMain" Then
        >>
        > frm.Close()
        >>
        >End If
        >>
        >Next
        >>
        >Everything was fine until I decided to use Sub Main as Startup object. In
        >order to have it in the list of startup objects I had to uncheck Enable
        >application framework. Since that I have My.Application. OpenForms
        >highlighted and IDE says 'OpenForms is not a member of
        >'CMS.My.MyAppl ication'
        >>
        >How can I have OpenForms collection in my project if I use Sub Main as
        >Startup object?
        >>
        >Thank you
        >>
        >vovan
        >
        >

        Comment

        Working...