Henry Gathigira Henry Gathigira - 6 months ago 36
Vb.net Question

How to Prevent double click on Save button

How do i prevent a user from clicking a save button twice and probably display something like "Please Wait" or Saving... in a vb.net windows forms application. I am trying

Buttonsave.Focus = False
labelSaving.Visible = True

Answer

There are many possibilities ...

This is a easy one

Try
   yourButton.enabled= false
   ' save
Catch(Ex as exception )
   'do something
Finally
  yourButton.enabled= true
End Try

Now, you can imporve this by performing "Save" into a task, checking the state, showing a "saving message"....