Idea on using visual basic lock key

Asked By 20 points N/A Posted on -
qa-featured

How can I lock button in visual basic? I have a couple of buttons and there are some buttons that I would like to lock or disable after pressing it. How can I do that? I need an idea on using visual basic lock key. Can you tell me step by step tutorial? Thank you so much.

SHARE
Best Answer by Head Jonathon
Best Answer
Best Answer
Answered By 0 points N/A #141727

Idea on using visual basic lock key

qa-featured

In visual Basic there is a Button property like “Enabled”. You can use this in order to disable the button.

You can set it to ‘false’. If you need the button to be disabled after the button click you can write it inside the ‘button click’ event.

Here is the sample code that does this function.

btnSubmit.Enabled = False

btnReset.Enabled = False

Answered By 0 points N/A #141728

Idea on using visual basic lock key

qa-featured

Hi,

Once one of my friends have faced same problem. I have found this solution from him.

You can make that button read only. Here is the variable track.

DimboolMakeReadOnly asBoolean= True

PrivateSubbtnSubmit_Click(ByValsender AsSystem.Object, ByVal e AsSystem.EventArgs) HandlesbtnSubmit. Click

IfboolMakeReadOnly ThenReturn'This exits the event

'Original code for the submit button (gets skipped if boolMakeReadOnly is true)

EndSub                  

Related Questions