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. Closing an application

Closing an application

Scheduled Pinned Locked Moved Visual Basic
questionsysadmin
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.
  • N Offline
    N Offline
    nahitan
    wrote on last edited by
    #1

    Hi there, I have a VB based application (.exe) and when you choose to close the application, one window pops up and ask if you really want to close the application, with Yes/No options, My question is how can I add a code to ask for a hard coded pass word if we want to close the application. So that the user would need to add a password to actualy being able to close it. I have this part in my app.: Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer) If MsgBox("Are you sure you want to Exit DCS?", vbYesNo + vbQuestion, "DSC (Data Car Server)") = vbNo Then Cancel = True End If End Sub Thanks,

    N K 2 Replies Last reply
    0
    • N nahitan

      Hi there, I have a VB based application (.exe) and when you choose to close the application, one window pops up and ask if you really want to close the application, with Yes/No options, My question is how can I add a code to ask for a hard coded pass word if we want to close the application. So that the user would need to add a password to actualy being able to close it. I have this part in my app.: Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer) If MsgBox("Are you sure you want to Exit DCS?", vbYesNo + vbQuestion, "DSC (Data Car Server)") = vbNo Then Cancel = True End If End Sub Thanks,

      N Offline
      N Offline
      No e
      wrote on last edited by
      #2

      It depends on how fancy you want to get, you could use in inputbox, I usually write my own form for passwords as teh injput box does not look real pretty....

      1 Reply Last reply
      0
      • N nahitan

        Hi there, I have a VB based application (.exe) and when you choose to close the application, one window pops up and ask if you really want to close the application, with Yes/No options, My question is how can I add a code to ask for a hard coded pass word if we want to close the application. So that the user would need to add a password to actualy being able to close it. I have this part in my app.: Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer) If MsgBox("Are you sure you want to Exit DCS?", vbYesNo + vbQuestion, "DSC (Data Car Server)") = vbNo Then Cancel = True End If End Sub Thanks,

        K Offline
        K Offline
        Kevin Nicol
        wrote on last edited by
        #3

        I don't think VB has any password Dialog Forms pre made so you would have to build a new form with a password box and pop it up when the unload event is raised. Then you can check the password with the hardcoded one. Kevin

        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