473,804 Members | 2,962 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

extra characters in textbox when using shortcut keys

In VS 2003 and VS 2005 beta 2 I am trying to write a simple program. It has
a datagrid and a textbox along with a menubar. There is a command in the
menu bar which is "Run Query" and has the shortcut key of Ctrl + R If I am
typing in my textbox and hit Ctrl + R an extra r character will show up in
the textbox. I decided to then try this in VS 2005 and the same thing
happens. If I include the following,

Private Sub txtQuery_KeyDow n(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles txtQuery.KeyDow n
If e.KeyCode = Keys.R And e.Control = True Then e.SuppressKeyPr ess =
True
End Sub

The the r character does not show up providing that an exception does not
occur. In VS 2005 I am taking advantage of the Application Events so that I
do not have to put Try Catch blocks everywhere.

Private Sub MyApplication_U nhandledExcepti on(ByVal sender As Object,
ByVal e As
Microsoft.Visua lBasic.Applicat ionServices.Unh andledException EventArgs)
Handles Me.UnhandledExc eption
MsgBox(My.Resou rces.Error_Gene ralMessage & vbNewLine &
e.Exception.Mes sage.ToString, MsgBoxStyle.Cri tical,
My.Application. Info.ProductNam e)
e.ExitApplicati on = False
End Sub

If an exception is thrown, when I press Ctrl + R and extra r will show up in
the textbox. Does anyone know how I could get around this problem? I could
tie Ctrl + R into the Keydown event or KeyPress of the textbox, but I would
like it to work even if it does not have focus. I had a previous post with
regards to global exceptions causing problems during this process and
discovered it was the 3rd party control that I was using that caused the
errors. Using the Microsoft controls fixed these issues but I keep
experencing what I mentioned above. Any help I would greatly appreciate
it... Thanks...
Jul 21 '05 #1
2 2152
Hi Nick,

I created one small application with one text box and one menubar with
shortcut key as Ctrl+R. In my application the extra "r" character is not
appearing in text at the time of pressing shorcut.

"Nick" wrote:
In VS 2003 and VS 2005 beta 2 I am trying to write a simple program. It has
a datagrid and a textbox along with a menubar. There is a command in the
menu bar which is "Run Query" and has the shortcut key of Ctrl + R If I am
typing in my textbox and hit Ctrl + R an extra r character will show up in
the textbox. I decided to then try this in VS 2005 and the same thing
happens. If I include the following,

Private Sub txtQuery_KeyDow n(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles txtQuery.KeyDow n
If e.KeyCode = Keys.R And e.Control = True Then e.SuppressKeyPr ess =
True
End Sub

The the r character does not show up providing that an exception does not
occur. In VS 2005 I am taking advantage of the Application Events so that I
do not have to put Try Catch blocks everywhere.

Private Sub MyApplication_U nhandledExcepti on(ByVal sender As Object,
ByVal e As
Microsoft.Visua lBasic.Applicat ionServices.Unh andledException EventArgs)
Handles Me.UnhandledExc eption
MsgBox(My.Resou rces.Error_Gene ralMessage & vbNewLine &
e.Exception.Mes sage.ToString, MsgBoxStyle.Cri tical,
My.Application. Info.ProductNam e)
e.ExitApplicati on = False
End Sub

If an exception is thrown, when I press Ctrl + R and extra r will show up in
the textbox. Does anyone know how I could get around this problem? I could
tie Ctrl + R into the Keydown event or KeyPress of the textbox, but I would
like it to work even if it does not have focus. I had a previous post with
regards to global exceptions causing problems during this process and
discovered it was the 3rd party control that I was using that caused the
errors. Using the Microsoft controls fixed these issues but I keep
experencing what I mentioned above. Any help I would greatly appreciate
it... Thanks...

Jul 21 '05 #2
Thanks for Ajay's quick response.

Hi Nick,

I also created a same app on my machine. It works fine without showing an
extra 'r' in the text box.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3349
by: Maurice Mertens | last post by:
Hi, I'm trying to set shortcut keys for textboxes. But what is the best way to do this in VB.NET. In Access it was very simple, just put an "&" sign in the label that belongs to the textbox. But in VB.NET it looks like you have to program code for the shortcut keys. Like putting this code in the Form_KeyUp: If e.Alt And e.KeyCode = Keys.L Then Me.ActiveControl = Me.TextBox1
11
3806
by: anony | last post by:
Hello, I can't figure out why my parameterized query from an ASP.NET page is dropping "special" characters such as accented quotes & apostrophes, the registered trademark symbol, etc. These symbols insert without problem from query analyzer, so that suggests it's something within ASP.NET. I've tried using .NET textbox web controls as well as html textareas. I have a test database set up with 4 fields: varchar, nvarchar, text, and...
2
29142
by: Jim S | last post by:
I am having a problem finding information regarding vb.net allowing you to create shortcut keys for buttons using the CTRL key + function buttons such as F1, F2 etc.. (Ex: Press CTRL+F1 to activate a click event on a button). If anyone could help it would be sincerely appreciated. Thank You!
5
2112
by: Powerguy | last post by:
Hi, I am trying to allow users to only be able to enter numeric numbers into a textbox. The problem is that I cannot move focus with the tab key even if I allow it as an allowable key stroke. I have successfully achieved this thanks to abit of code I found from within these forums (thanks who ever posted it!): Protected Overrides Function ProcessDialogKey(ByVal keydata As System.Windows.Forms.Keys) As Boolean
2
270
by: Nick | last post by:
In VS 2003 and VS 2005 beta 2 I am trying to write a simple program. It has a datagrid and a textbox along with a menubar. There is a command in the menu bar which is "Run Query" and has the shortcut key of Ctrl + R If I am typing in my textbox and hit Ctrl + R an extra r character will show up in the textbox. I decided to then try this in VS 2005 and the same thing happens. If I include the following, Private Sub...
11
11189
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in a text box. I know that there are certain control characters embedded in the data that I want to display substitutions for in the text box, for instance I want to replace ASCII character 04 with the string "<EOT>". I have tried doing a simple...
3
1524
by: Michel Vanderbeke | last post by:
Hello, I would like to create a textbox with extra properties where I can choose if the textbox may contain only numbers, only letters, both, punctuation marks etc. Can anyone help me with tips how I can realise this? Many thanks, Michel
4
5505
by: Martin.Kunc | last post by:
Hallo all, I need to make an textbox to accept only Cyrilic characters. I couldn't found any solution except enumerate characters for filtering (seems odd). Please has anyone any ideas ? Thank you all, Martin
0
2649
by: thirunavukarasukm | last post by:
Hai... How to Usercontrols with Shortcut Keys... I am creating one windows apllication.. the apllication contain many form.. in one form i am used one usercontrol(parent control)..
0
9571
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
10318
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
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
9132
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
7608
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
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
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
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
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.