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. How can I disable a Save button or Print Buttton after saving a form in Visualbasic 6.0

How can I disable a Save button or Print Buttton after saving a form in Visualbasic 6.0

Scheduled Pinned Locked Moved Visual Basic
question
5 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.
  • U Offline
    U Offline
    User 13659767
    wrote on last edited by
    #1

    Please how can I disable a Save button after a user submits a form, the aim is to prevent user from modifying any changes after saving on the form in visual basic 6.0. Same with Print button, after a user prints a form, how can i disable the form so the user cannot print that particular form on the same visual basic 6.0. I will be so grateful for you response. Damian

    C 1 Reply Last reply
    0
    • U User 13659767

      Please how can I disable a Save button after a user submits a form, the aim is to prevent user from modifying any changes after saving on the form in visual basic 6.0. Same with Print button, after a user prints a form, how can i disable the form so the user cannot print that particular form on the same visual basic 6.0. I will be so grateful for you response. Damian

      C Offline
      C Offline
      Chris Quinn
      wrote on last edited by
      #2

      1. Stop using VB6 - it has not been supported for over 10 years 2. If you have to use VB6 you can disable a button by setting its enabled property to false

      ========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================

      U 1 Reply Last reply
      0
      • C Chris Quinn

        1. Stop using VB6 - it has not been supported for over 10 years 2. If you have to use VB6 you can disable a button by setting its enabled property to false

        ========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================

        U Offline
        U Offline
        User 13659767
        wrote on last edited by
        #3

        Thanks for the response. Meanwhile I am trying to upgrade to VB.net Pending when I wish to still ask based on your response. How do I write the VB code to set its enabled property to false only after saving/printing a form. The aim is to prevent user from modifying or printing same form. Thanks in advance

        D C 2 Replies Last reply
        0
        • U User 13659767

          Thanks for the response. Meanwhile I am trying to upgrade to VB.net Pending when I wish to still ask based on your response. How do I write the VB code to set its enabled property to false only after saving/printing a form. The aim is to prevent user from modifying or printing same form. Thanks in advance

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

          No, you disable the button BEFORE your code to save it or print it.

          mySaveButton.Enabled = False
          

          But, keep in mind that your code will not be able to stop a user from hitting the PrtScn button, pasting the screen shot into paint and printing it from there.

          Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
          Dave Kreskowiak

          1 Reply Last reply
          0
          • U User 13659767

            Thanks for the response. Meanwhile I am trying to upgrade to VB.net Pending when I wish to still ask based on your response. How do I write the VB code to set its enabled property to false only after saving/printing a form. The aim is to prevent user from modifying or printing same form. Thanks in advance

            C Offline
            C Offline
            Chris Quinn
            wrote on last edited by
            #5

            Assuming your buttons are called btnPrint and btnSave, in their click events add the line

            btnPrint.enabled = False

            or

            btnSave.enabled = False

            ========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================

            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