editing state
-
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
Use the Enabled property of each control. For example:
TextBox1.Enabled = False
MenuItem2.Enabled = False
MenuItem1.Enabled = TrueRageInTheMachine9532
-
Use the Enabled property of each control. For example:
TextBox1.Enabled = False
MenuItem2.Enabled = False
MenuItem1.Enabled = TrueRageInTheMachine9532
-
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
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 Suband in the click event of the Stop button:
Private Sub btnStop_Click(...)
btnStop.Enabled = False
btnStart.Enabled = True
... stop whatever process you started...
End SubBut, you usually NEVER change the enabled status of controls based on the enabled status of another. RageInTheMachine9532
-
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 Suband in the click event of the Stop button:
Private Sub btnStop_Click(...)
btnStop.Enabled = False
btnStart.Enabled = True
... stop whatever process you started...
End SubBut, you usually NEVER change the enabled status of controls based on the enabled status of another. RageInTheMachine9532
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
-
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
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