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. editing state

editing state

Scheduled Pinned Locked Moved Visual Basic
helptutorial
6 Posts 2 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.
  • I Offline
    I Offline
    ibok23
    wrote on last edited by
    #1

    I have created a sub procedure named EditState. This is to enable and siable menu items as necessary. Enable or disable text boxes also. I do not know how to do this. Can anybody help.:| Thank you, ibok23

    D 1 Reply Last reply
    0
    • I ibok23

      I have created a sub procedure named EditState. This is to enable and siable menu items as necessary. Enable or disable text boxes also. I do not know how to do this. Can anybody help.:| Thank you, ibok23

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

      Use the Enabled property of each control. For example:

      TextBox1.Enabled = False
      MenuItem2.Enabled = False
      MenuItem1.Enabled = True

      RageInTheMachine9532

      I 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Use the Enabled property of each control. For example:

        TextBox1.Enabled = False
        MenuItem2.Enabled = False
        MenuItem1.Enabled = True

        RageInTheMachine9532

        I Offline
        I Offline
        ibok23
        wrote on last edited by
        #3

        Do I do an if then statement? For example If MenuItem7.enable = true then MenuItem5.enable = false MenuItem6.enable = false MenuItem10.enable = false Else If MenuItem5.enable = true then MenuItem6.enable = false so on and so on.. Thank you, ibok23

        D 1 Reply Last reply
        0
        • I ibok23

          Do I do an if then statement? For example If MenuItem7.enable = true then MenuItem5.enable = false MenuItem6.enable = false MenuItem10.enable = false Else If MenuItem5.enable = true then MenuItem6.enable = false so on and so on.. Thank you, ibok23

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

          Usually not. It all depends on what your doing and your design. You usually don't enable or disable menu items unless some kind of mode has changed in your program, like when Visual Studio goes from editing code to debugging. For instance, if you have two buttons on a form, Start and Stop, you would normally start the app with the Start button enabled and the Stop button disabled. When you click Start:

          Private Sub btnStart_Click(...)
          btnStart.Enabled = False
          btnStop.Enabled = True
          ... start some process ...
          End Sub

          and in the click event of the Stop button:

          Private Sub btnStop_Click(...)
          btnStop.Enabled = False
          btnStart.Enabled = True
          ... stop whatever process you started...
          End Sub

          But, you usually NEVER change the enabled status of controls based on the enabled status of another. RageInTheMachine9532

          I 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Usually not. It all depends on what your doing and your design. You usually don't enable or disable menu items unless some kind of mode has changed in your program, like when Visual Studio goes from editing code to debugging. For instance, if you have two buttons on a form, Start and Stop, you would normally start the app with the Start button enabled and the Stop button disabled. When you click Start:

            Private Sub btnStart_Click(...)
            btnStart.Enabled = False
            btnStop.Enabled = True
            ... start some process ...
            End Sub

            and in the click event of the Stop button:

            Private Sub btnStop_Click(...)
            btnStop.Enabled = False
            btnStart.Enabled = True
            ... stop whatever process you started...
            End Sub

            But, you usually NEVER change the enabled status of controls based on the enabled status of another. RageInTheMachine9532

            I Offline
            I Offline
            ibok23
            wrote on last edited by
            #5

            ok, I have on top file,edit,and Navigate. Under file is exit, under edit are add, edit, update, cancel update and delete. Under Navigate are first, next, previous and last. The instructions are Create the code for the Add, edit, update, cancel, and delete menu items, create a sub procedure name EditState to enable and disable menu items as necessary. Enable or disable the text boxes also. so far I have in the code under the sub of add is

            Call EditState (cblnNotEditing)
            Me.BindingContext (DsParts1, "tblparts").addNew()

            I have nothing underneath the editState, I am not sure what to put there. I found this in my book telling me this is what I am suppose to type. I have an error under (cblnNotEditing). I am not sure what this cblnNotEditing means. I am just putting what the book is telling me. Thank you, ibok23

            D 1 Reply Last reply
            0
            • I ibok23

              ok, I have on top file,edit,and Navigate. Under file is exit, under edit are add, edit, update, cancel update and delete. Under Navigate are first, next, previous and last. The instructions are Create the code for the Add, edit, update, cancel, and delete menu items, create a sub procedure name EditState to enable and disable menu items as necessary. Enable or disable the text boxes also. so far I have in the code under the sub of add is

              Call EditState (cblnNotEditing)
              Me.BindingContext (DsParts1, "tblparts").addNew()

              I have nothing underneath the editState, I am not sure what to put there. I found this in my book telling me this is what I am suppose to type. I have an error under (cblnNotEditing). I am not sure what this cblnNotEditing means. I am just putting what the book is telling me. Thank you, ibok23

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

              You're asking me? You have the book! 8) What's this program supposed to do? A text editor like notepad? And what's with the BindingContext? DataBindings sound like they are a few levels above you right now... What book is this? As for what cblnNotEditing is, I couldn't tell you. Just the name of the variable/class/object/whatever isn't enough to tell you what's going on. RageInTheMachine9532

              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