How can i make a button unpressable without making it grey in Visual Basic 2008 Express? - basic grey
I have a button when the press can not be rejected, but I do not want the command button1.Enabled = false, because it makes the gray button. The button colors and fonts, and if you use the command after pressing the button gray. I will not. Please give an example of program code, because I started Yesturday that says so try to use something like: (another) command. Here is my code:
If Label2.ForeColor = Color.Red Then
Button5.Text = "O"
Button5.ForeColor = Color.Blue
Label2.ForeColor = Color.Black
Label1.ForeColor = Color.Red
Label2.ForeColor = Color.Black Then ElseIf
Button5.Text = "X"
Button5.ForeColor = Color.Red
Label2.ForeColor = Color.Red
Label1.ForeColor = Color.Black
Button5.enabled = False
Call Winning_Rule ()
End If
Thank you in advance.
Basic Grey How Can I Make A Button Unpressable Without Making It Grey In Visual Basic 2008 Express?
10:32 AM
1 comments:
If you do not want the button's Enabled property is set to false, the other way to reach your target in order to change the key event handler. You have to add a global level and form-level indicator to monitor whether the button is pressed or not. eg
On the (declarations) section of a form with code like this:
BlnButtonClicked as Boolean Dim
Then you change the event handler () subroutine Button1_Click eg something like this:
If blnButtonClicked = False
...
, Put the code that you want to run
The first time you on the button below --
...
blnButtonClicked = True
ENDIF
The first time you press the button, the code, then a flag is to say that you clicked. All clicks will be ignored, because now the flag is set.
Post a Comment