473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to Usercontrols with Shortcut Keys[F1,F2,F3,CTRL+O]...

Hai...

How to Usercontrols with Shortcut Keys[F1,F2,F3,CTRL+O]...

I am creating one windows apllication..

the apllication contain many form..

in one form i am used one usercontrol(parent control)..

the many form used in that inherited usercontrol(child control)..

in my form i want to use shorcut keys

in usercontrol form does not have keypreview property..

so i am use the shortcut function keys

i have add,edit,delete,and search for various button in my usercontrol form

i want to put the shorcut key to each every buttons

this is my code..this nopt worked..

Private Sub frmTemplate_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

Try

If (e.KeyCode = Keys.F1) And mblnAddEnable = True Then

btnAdd_Click(sender, e)

ElseIf (e.KeyCode = Keys.F2) And mblnEditEnable = True Then

btnEdit_Click(sender, e)

ElseIf e.KeyCode = Keys.F3 And mblnDelEnable = True Then

btnDelete_Click(sender, e)

ElseIf e.KeyCode = Keys.F7 Then

btnCancel_Click(sender, e)

ElseIf e.KeyCode = Keys.F6 And mblnAdd = False And mblnEdit = False Then

btnFilter_Click(sender, e)

End If

If e.KeyCode = Keys.Enter Then

SendKeys.Send("{Tab}")

End If

Catch ex As Exception

msgbox(ex.Message.ToString())

End Try

End Sub

I am not have the keypreview property in desinging mode..

please help me..

how to use the shortcut keys



please reply me..........
Aug 16 '07 #1
0 2617

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Lex | last post by:
I am writing a C# app that has a Menu. Some of the menu items will have short cuts that do not exist in the Shortcut enum. I would like the custom shortcuts to appear on the menu but as far as I...
3
by: Armando | last post by:
Apologies if this has been covered recently - I lurked and saw nothing. I have an application that does ticketing at a three-screen movie theatre, and I'm using the function keys F1 thru F12...
3
by: cyshao | last post by:
How to add a shortcut Ctrl+S ? I want to add a new function for user to provide Ctrl+S to save things. How can I do that? Thanks Charles Shao^_^
2
by: touf | last post by:
Hi, I like to associate the shortcut "<CTRL> N" to a button "New".. I've tried to add the char & to it's label..but it uses the Alt key.. Any idea please for using the CTRL key? Thanks
2
by: Stephen | last post by:
Greetings All.. My boss want me to add code in a form that disables most, if not all function keys on the keyboard.... Im at a lose on how to do it.... any help is appreciated s
10
by: Michael Maes | last post by:
Hi, I want to have a Button.Click event 'raise' a shortcut. If eg Button1 is Clicked, I want to have a shortcut 'CTRL + F12' activated. What's the best way to acchieve this. TIA, Michael
0
by: Andrus | last post by:
MDI WinForms 2 application. I need that Ctrl+F1 cycles through windows like Ctrl+Tab and Ctrl+Tab is redefined. I overrided MDI child form OnKeypress method but Ctrl+F1 press is ignored. For...
2
by: John | last post by:
Hi How can I capture control keys Ctrl-A, Ctrl-B, Ctrl-C etc. in a form? Thanks Regards
0
by: Aads | last post by:
Hi there, Is there any keyboard shortcut for moving the splitter up and down like we did in SQL 2000 with shortcut CTRL+B. Is there a way to do the same in SQL 2005? Thanks, Aads
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.