Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check Input
#1
Ok im making it so when you hit F5 it shows or hides the chat menu. I got it semi working. I went to check input and at the end added...

Code:
If KeyCode = vbKeyF5 Then
            If frmMirage.picChat.Visible = True Then
            frmMirage.picChat.Visible = False
           ElseIf frmMirage.picChat.Visible = False Then
            frmMirage.picChat.Visible = True
            End If
            End If

The problem with this if you cant tell is when you hide it ... it sees visible is false so then it shows it again and so on...

how else should I do this... I tried making a whole new thing... like if F5 then .... but that didnt work...
Reply
#2
Add exit sub.
Reply
#3
Code:
If KeyCode = vbKeyF5 And frmMirage.picChat.Visible = True Then
        frmMirage.picChat.Visible = False
    Else
    If frmMirage.picChat.Visible = False Then
        frmMirage.picChat.Visible = True
    End If

Revised.

:: Pando
Reply
#4
Code:
If KeyCode = vbKeyF5 And frmMirage.picChat.Visible = True Then
        frmMirage.picChat.Visible = False
    ElseIf  KeyCode = vbKeyF5 And frmMirage.picChat.Visible = False Then
        frmMirage.picChat.Visible = True
    End If

You forgot to check if F5 was being pressed when visibility = false, therefore, whenever it checked input, it would check if visibilty was false and set it to true
Reply
#5
Ok I got it ... it wasnt any of those methods and I kept putting it in keyup instead of keydown I beleive that was a problem too.
Reply
#6
hmm bugger, I copied the code form wrong person :|
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)