Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

KeyPress help

Ok i'm kinda new to VB and I was wondering how to go if like you press down "4" while using a program, like a webrowser for example(because that's what im making) how would i make it do something like make Panel1 visible when you press a key?

P.S. My friend wants to know how to make a windows pop up when you click a button

Comments

  • DaiMitnickDaiMitnick Member Posts: 77
    if you're using vb.net you're gonna need something like:

    Private Sub Calc_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    Select Case e.KeyCode
    Case Keys.NumPad0
    Call ButtonNum0_Click(sender, e)
    Case Keys.NumPad1
    Call ButtonNum1_Click(sender, e)
    Case Keys.NumPad2
    Call ButtonNum2_Click(sender, e)
    Case Keys.NumPad3
    Call ButtonNum3_Click(sender, e)
    Case Keys.Decimal
    Call ButtonNumDot_Click(sender, e)
    Case Keys.O
    Call ButtonNum00_Click(sender, e)
    End Select
    End If
    End Sub

    If you're using vb6 (which I'm guessing you are) then you should find the answer you need in this thread:

    http://www.programmersheaven.com/mb/VBasic/263630/263630/vb6-detect-keypress/?S=B20000


    Hope this helps, Dai.


    Do or do not, there is no try.
Sign In or Register to comment.