Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Stop vb2008 from checking detailed sub of the the form before running the application

Stop vb2008 from checking detailed sub of the the form before running the application

Scheduled Pinned Locked Moved Visual Basic
help
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aiman Farouk Mohamed
    wrote on last edited by
    #1

    Dear All I am using public form to handle the current form in the mdiform like Public frm As windows.forms.form and then assign it to a form using the following lines frm = New Form1 frm.MdiParent = Me frm.Show() and usually calling common sub included in every form but vb2008 shows and error while debugging before run the application checks the included sub in the public form before assigning a form to it and shows "sub name " is not a member of 'System.Windows.Forms.Form could anyone help me to avoid this error or show me an alternative way. Regards Aiman Farouk

    A D 2 Replies Last reply
    0
    • A Aiman Farouk Mohamed

      Dear All I am using public form to handle the current form in the mdiform like Public frm As windows.forms.form and then assign it to a form using the following lines frm = New Form1 frm.MdiParent = Me frm.Show() and usually calling common sub included in every form but vb2008 shows and error while debugging before run the application checks the included sub in the public form before assigning a form to it and shows "sub name " is not a member of 'System.Windows.Forms.Form could anyone help me to avoid this error or show me an alternative way. Regards Aiman Farouk

      A Offline
      A Offline
      ABitSmart
      wrote on last edited by
      #2

      Aiman Farouk Mohamed wrote:

      "sub name " is not a member of 'System.Windows.Forms.Form

      The error indicates that the subroutine is not found in the object your trying to call it from. I presume your subroutine is implemented in the Form1 object ?? You can either cast it or change the form variable to Form1 insteast of Windows.Forms.Form

      Public frm As Form1
      frm.YourSubroutine()

      Or using your exisiting code, replace the call to the subroutine as

      (frm as Form1).YourSubroutine()

      1 Reply Last reply
      0
      • A Aiman Farouk Mohamed

        Dear All I am using public form to handle the current form in the mdiform like Public frm As windows.forms.form and then assign it to a form using the following lines frm = New Form1 frm.MdiParent = Me frm.Show() and usually calling common sub included in every form but vb2008 shows and error while debugging before run the application checks the included sub in the public form before assigning a form to it and shows "sub name " is not a member of 'System.Windows.Forms.Form could anyone help me to avoid this error or show me an alternative way. Regards Aiman Farouk

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        This doesn't work because you created a normal (nothing on it) instance of a Form class. If you already have a form defined, you should be creating an instace of THAT form, not System.Windows.Form.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups