6 Replies - 62020 Views - Last Post: 03 June 2007 - 02:27 PM Rate Topic: -----

#1 ramper04  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 12
  • Joined: 13-December 06

Using the "enter" key as an event trigger

Posted 20 April 2007 - 03:25 PM

Does anybody know if you can use the "enter" key as an event trigger?
I am trying to make an entry form for a drawing and would like to use the enter key or any key for that matter so that i dont have to supply a mouse and a button that needs to be clicked to submit the form.
If anybody knows what the code for that would be it will be greatly appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: Using the "enter" key as an event trigger

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Using the "enter" key as an event trigger

Posted 20 April 2007 - 04:01 PM

You can use the KeyPress event of a control to capture these types of events.

http://www.timkey.ne...dotnet/349.aspx
Was This Post Helpful? 0
  • +
  • -

#3 frozen_sun  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 30-April 07

Re: Using the "enter" key as an event trigger

Posted 03 May 2007 - 10:51 PM



in keypress event

if e.keychar=13 then
do what you like to do
else
end if

'13 represents ENTER KEY


Was This Post Helpful? 0
  • +
  • -

#4 kyrotomia  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 72
  • Joined: 05-May 07

Re: Using the "enter" key as an event trigger

Posted 05 May 2007 - 06:46 PM

Just a little note :
Instead of using "ee.keychar=13" ,you could use controlchars.cr to replace 13. This shows all the different keys, wich is pretty useful if you don't plan to memorize all the codes.
Was This Post Helpful? 0
  • +
  • -

#5 ramper04  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 12
  • Joined: 13-December 06

Re: Using the "enter" key as an event trigger

Posted 09 May 2007 - 07:34 PM

Those all worked!!
Thanks for the help!
Was This Post Helpful? 0
  • +
  • -

#6 killkenny55  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 01-June 07

Re: Using the "enter" key as an event trigger

Posted 01 June 2007 - 06:46 PM

i get an error when i put
e.KeyChar = 13

it says Operator '=' is not define for types 'Char and 'Integer'
Was This Post Helpful? 0
  • +
  • -

#7 fahimbhamla  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 6
  • Joined: 03-June 07

Re: Using the "enter" key as an event trigger

Posted 03 June 2007 - 02:27 PM

View Postkillkenny55, on 1 Jun, 2007 - 06:46 PM, said:

i get an error when i put
e.KeyChar = 13

it says Operator '=' is not define for types 'Char and 'Integer'

use
e.KeyChar = ControlChars.Cr


Was This Post Helpful? 1

Page 1 of 1