Quick Question

Discussion in 'Archives' started by bad_moose, Feb 25, 2010.

Thread Status:
Not open for further replies.
Quick Question
  1. Unread #1 - Feb 25, 2010 at 2:16 PM
  2. bad_moose
    Joined:
    Jul 31, 2008
    Posts:
    1,305
    Referrals:
    0
    Sythe Gold:
    0

    bad_moose Guru

    Quick Question

    Hello everyone, I was just wondering how I would go about making it so a button which currently performs an action will perform the same action if I press the enter key instead? I am using Visual Basic 2008 express edition. Could someone also tell me what the dimensions of a normal window are? (EG, full size window on google chrome) Thanks :)
     
  3. Unread #2 - Feb 28, 2010 at 1:57 PM
  4. Visual Basic Matt
    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056

    Visual Basic Matt Apprentice

    Quick Question

    To detect enter keypress you can use a timer which will check if the key is pressed and then click the button within code. Or you can place the code inside the if statement.

    Code:
    If e.KeyCode = Keys.Enter Then
    Button1.PerformClick()
    end if
    A full sized window can really depend on the computers resolution. If you want to get the dimensions of the users full sized window you can use.
    Code:
            Dim DimensionX
            Dim DimensionY
            'Put window in its maximized state
            Me.WindowState = FormWindowState.Minimized
            'Grab width and height of window
            dimensionx = Me.Width
            DimensionY = Me.Height
     
  5. Unread #3 - Mar 1, 2010 at 3:11 PM
  6. bad_moose
    Joined:
    Jul 31, 2008
    Posts:
    1,305
    Referrals:
    0
    Sythe Gold:
    0

    bad_moose Guru

    Quick Question

    Thanks Matt :)
     
  7. Unread #4 - Apr 20, 2010 at 8:33 AM
  8. vbpro
    Joined:
    Apr 20, 2010
    Posts:
    91
    Referrals:
    0
    Sythe Gold:
    0

    vbpro Member
    Banned

    Quick Question

    Its a hotkey so as matt said its

    if e.keycode = keys.enter then
    Button1.Performclick ()
    end if
     
< Help | VB6 Login forms... >

Users viewing this thread
1 guest
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site