Using Keypress
Posted
#1
(In Topic #312)
Regular

key was a numeric number or not. Might be a good routine to place into a
calculator program or a program where you can use keyboard numbers
entered.
Code (gambas)
- ' Gambas class file
- '*********************************
- 'Insert a label and text box
- 'on the default window
- 'and leave them as the default
- 'names
- '*********************************
- '*********************************
- 'Assign the keycode to strChar
- '*********************************
- '**********************************
- 'If the Key.Code is Key.Esc then
- 'close the window.
- '**********************************
- '***************************************
- 'Check to see if strChar is a number
- '***************************************
- '***********************************************
- 'If false then report not a number
- 'and report False
- '************************************************
- Label1.Text = "False"
- TextBox1.Text = "Not a number "
- '*************************************
- 'If strChar is a number then display
- 'the number and reprot true
- '*************************************
- Label1.Text = "True"
- TextBox1.Text = strChar
Posted
Guru

1 guest and 0 members have just viewed this.


