Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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 Posts: 77Member
    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.