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. Close function

Close function

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
4 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.
  • H Offline
    H Offline
    harveyhanson
    wrote on last edited by
    #1

    In VB.NET 2005: is there any way to link the close button on the control box to another form rather than shutting the program, or is this close function set in stone??? Cheers

    N 1 Reply Last reply
    0
    • H harveyhanson

      In VB.NET 2005: is there any way to link the close button on the control box to another form rather than shutting the program, or is this close function set in stone??? Cheers

      N Offline
      N Offline
      nlarson11
      wrote on last edited by
      #2

      there is no built in link but you can create your own. in the closing event of the form1 cancel the close. then close form2 instead -- obviously requires that form1 has a pointer to form2.

      H 1 Reply Last reply
      0
      • N nlarson11

        there is no built in link but you can create your own. in the closing event of the form1 cancel the close. then close form2 instead -- obviously requires that form1 has a pointer to form2.

        H Offline
        H Offline
        harveyhanson
        wrote on last edited by
        #3

        Can you put an example of how this formclosing works, I have tried to declare it as a public class then put some code in, is this correct?

        D 1 Reply Last reply
        0
        • H harveyhanson

          Can you put an example of how this formclosing works, I have tried to declare it as a public class then put some code in, is this correct?

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

          It's an event handler, just like Form Load, that gets called when the form is told to close. Docs on it are here[^].

          Dave Kreskowiak Microsoft MVP - Visual Basic

          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