We all know that you can control the on / off of ToolStrip buttons when changing the state of a form using operators Select Case(VB.NET) or switchin C #.
But I remember, my teacher said: "Using these statements is not the right way when developing software using OOP."
Private Sub SetToolStripButtons()
Select Case formState
Case FormStates.Normal
btnSave.Enabled = False
btnCancel.Enabled = False
btnNew.Enabled = True
btnEdit.Enabled = True
Case FormStates.Edit
btnSave.Enabled = True
btnCancel.Enabled = True
btnNew.Enabled = False
btnEdit.Enabled = False
'.....
'.....
End Select
End Sub
EDIT: I added a simple code snippet above
So what would you recommend instead?
source
share