473,411 Members | 2,013 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,411 software developers and data experts.

TextBox - what is going wrong?

Hi,

I have a TextBox on my form.

I capture the KeyDown event and examines the e.KeyValue - that is, I
examine it like this: dim chr = chr(KeyValue).

This seams to work ok .... well almost.

In Denmark we have some special characters like this one (hope you can
see it): "ø", which is a circle with a line through it.

The text box writes the special characters without any problem, but the
chr(e.KeyValue) shows a strange character and e.KeyCOde & e.KeyData
writes OemQuotes.

What is going on here? Do I have to set some kind of localize info??

Thanks!!

M O J O

Jul 19 '05 #1
2 2096
"M O J O" <mojo@____no____spa_m___newwebsolutions.dk> wrote in message
news:3F16B9B7.4080404@____no____spa_m___newwebsolu tions.dk...
Hi,

I have a TextBox on my form.

I capture the KeyDown event and examines the e.KeyValue - that is, I
examine it like this: dim chr = chr(KeyValue).

This seams to work ok .... well almost.

In Denmark we have some special characters like this one (hope you can
see it): "ø", which is a circle with a line through it.

The text box writes the special characters without any problem, but the
chr(e.KeyValue) shows a strange character and e.KeyCOde & e.KeyData
writes OemQuotes.

What is going on here? Do I have to set some kind of localize info??


Wierd, it works for me (ø = ALT+0248) - when I key it into a text box, it
works with the following code just fine (KeyPress):

Debug.WriteLine(e.KeyChar)
If e.KeyChar = Chr(248) Then
MsgBox(e.KeyChar)
End If

But since I don't have a keyboard that has that symbol, I can't test with
key-down... So I guess this is no help. Sorry.

Jeremy

Jul 19 '05 #2
"M O J O" <mojo@____no____spa_m___newwebsolutions.dk> schrieb
I have a TextBox on my form.

I capture the KeyDown event and examines the e.KeyValue - that is, I
examine it like this: dim chr = chr(KeyValue).

This seams to work ok .... well almost.

In Denmark we have some special characters like this one (hope you
can see it): "ø", which is a circle with a line through it.

The text box writes the special characters without any problem, but
the chr(e.KeyValue) shows a strange character and e.KeyCOde &
e.KeyData writes OemQuotes.

What is going on here? Do I have to set some kind of localize
info??


Keydown is used to receive keys, not chars. Use Keypress to evaluate chars.
Keyvalues are not character values. For example, pressing the "A" key fires
keydown with keycode = Keys.A, but the resulting char might be "a", "A", or
chr(1) depending on the state of the shift and ctrl keys. Another example:
function keys. They produce keydown events but no keypress events because
they are not translated to chars.

Armin

Jul 19 '05 #3

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

Similar topics

4
by: Thomas | last post by:
I am adding a bunch of textboxs dyanmically as shown below TextBox tb = new TextBox(); tb.ID = DR.GetName(y).ToString(); //Last_Name tb.Text = DR.ToString(); tb.Width = 200;...
28
by: kfrost | last post by:
I know this is probably simple but I have a C# form and the class for the form is called sbaSynch. I have a textbox name txtServerName. I'm creating a class to manipulate XML functions so I...
1
by: Jan Van Steenbergen | last post by:
Hi all i'm having a little problem I have a aspx file with a iFrame defined The iframe is loaded with a html webeditor After editing data in the webeditor textbox, i want t get the data to a...
1
by: Jan Van Steenbergen | last post by:
Hi all i'm having a little problem I have a aspx file with a iFrame defined The iframe is loaded with a html webeditor After editing data in the webeditor textbox, i want t get the data to a...
8
by: tshad | last post by:
I cannot seem to get the asp:textbox to use classes. Style works fine. I am trying to set the textbox to act like a label in some instance so it doesn't have a border, readonly and the background...
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?
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
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.