• Log in or sign up for an account here: https://www.sythe.org/login

Quick Question

Status
Not open for further replies.

bad_moose

Guru
Joined
Jul 31, 2008
Sythe Gold
0
Messages
1,305
Location
UK
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 :)
 
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
 
Status
Not open for further replies.
Runescape Gamblingrunescape gambling
Back
Top