473,833 Members | 2,199 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

21 New Member
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(par ent control)..

the many form used in that inherited usercontrol(chi ld 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_Key Down(ByVal sender As Object, ByVal e As System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown

Try

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

btnAdd_Click(se nder, e)

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

btnEdit_Click(s ender, 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.Messa ge.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 2649

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

Similar topics

10
2591
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 can tell there is no way to add a short cut that is not in the Shortcut enum. I have my on keyboard hook so I am not worried about the custom shortcut magically working. I just want it to appear nicely formated on the menu. Anyone have any...
3
9171
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 due to their intuitive layout. I KeyPreview them to the form, and read them using the KeyDown event (since KeyPress doesn't see non-ANSI keys). Everything works fine, EXCEPT.
3
23996
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
1248
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
1116
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
1963
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
1324
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 unknown reason base.ProcessCmdKey calls method itself. How to fix ? Andrus.
2
3103
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
1350
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
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10213
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9323
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4422
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3078
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.