2 Replies - 2954 Views - Last Post: 02 February 2011 - 06:24 AM Rate Topic: -----

#1 NavilShah  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 50
  • Joined: 02-November 10

Set Focus to Control using Shortcut Key

Posted 02 February 2011 - 05:39 AM

Hello Experts...,,,

I have to set focus on combobox control when F2 key is pressed on the key board...
But can't Find any way to do this....

Please Help.... :/

Moreover I'm using Devexpress Lookupedit control.....
Is This A Good Question/Topic? 0
  • +

Replies To: Set Focus to Control using Shortcut Key

#2 Jack Eagles1  Icon User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 183
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Re: Set Focus to Control using Shortcut Key

Posted 02 February 2011 - 06:19 AM

Well set the KeyPreview property of the form to true. Then in the Form_KeyDown event, add this code:
If e.KeyCode = Keys.F2 Then
   Richbox1.Focus 'Or whatever the name of your control is...
End If


Was This Post Helpful? 1
  • +
  • -

#3 NavilShah  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 50
  • Joined: 02-November 10

Re: Set Focus to Control using Shortcut Key

Posted 02 February 2011 - 06:24 AM

Thanks. it worked.... :)

View PostJack Eagles1, on 02 February 2011 - 06:49 PM, said:

Well set the KeyPreview property of the form to true. Then in the Form_KeyDown event, add this code:
If e.KeyCode = Keys.F2 Then
   Richbox1.Focus 'Or whatever the name of your control is...
End If


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1