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. VB.Net - Close a form

VB.Net - Close a form

Scheduled Pinned Locked Moved Visual Basic
helpcsharpquestion
4 Posts 4 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.
  • D Offline
    D Offline
    directred
    wrote on last edited by
    #1

    I wonder if anyone can help me solve this problem. On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading. I have tried Unload, me.Close, formname.Close but with no success. Keep getting errors. Is the problem with the Load event? I have tried closing the form from a procedure I created but no luck. I am properly doing something really stupid or missing sometning simple out.

    W M N 3 Replies Last reply
    0
    • D directred

      I wonder if anyone can help me solve this problem. On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading. I have tried Unload, me.Close, formname.Close but with no success. Keep getting errors. Is the problem with the Load event? I have tried closing the form from a procedure I created but no luck. I am properly doing something really stupid or missing sometning simple out.

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      directred wrote:

      On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading

      It's a bit late to do the decision in that point. Could you modify the opening logic so that you don't open the form at all if your test fails (don't even create it).

      directred wrote:

      Is the problem with the Load event

      I think it's by design.

      The need to optimize rises from a bad design.My articles[^]

      1 Reply Last reply
      0
      • D directred

        I wonder if anyone can help me solve this problem. On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading. I have tried Unload, me.Close, formname.Close but with no success. Keep getting errors. Is the problem with the Load event? I have tried closing the form from a procedure I created but no luck. I am properly doing something really stupid or missing sometning simple out.

        M Offline
        M Offline
        MarcelloTurnbull
        wrote on last edited by
        #3

        Please copy and paste the error messages so that I can help you Cheers Marcello Turnbull

        1 Reply Last reply
        0
        • D directred

          I wonder if anyone can help me solve this problem. On a form load, I do a simple yes/no test. If I say No, then I want to close the form I am loading. I have tried Unload, me.Close, formname.Close but with no success. Keep getting errors. Is the problem with the Load event? I have tried closing the form from a procedure I created but no luck. I am properly doing something really stupid or missing sometning simple out.

          N Offline
          N Offline
          Nanda_MR
          wrote on last edited by
          #4

          If ur using single Form then use 'End' and check the event once.

          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