Hey! Me again! A week or so ago, you folks really taught me how to use the KeyData event. I adopted some of the coding to make my new code so much better. A few days ago, I thought I figured out how to run my little game. You see, you have two buttons. Comment and Uncomment. You Press Control + K and then after that, you press Control + (C or U) to activate the buttons. And I thought it worked! But my buddy figured out how to break it! The thing is, I need to figure out a way to make IsCtrlK (Look below) False if any key that isn't Control + C or U is pressed right after it. What would you suggest I look into using?
Here is the code.
Code:Dim IsCtrlK As Boolean Select Case e.KeyData Case Keys.Control Or Keys.K IsCtrlK = True End Select If IsCtrlK = True Then Select Case e.KeyData Case Keys.Control Or Keys.C ToolstripButtonCommentText.PerformClick() IsCtrlK = False Case Keys.Control Or Keys.U ToolstripButtonUncommentText.PerformClick() IsCtrlK = False End Select End If




Reply With Quote