473,396 Members | 2,011 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,396 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

Nov 19 '05 #1
2 1479
"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

Nov 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

Nov 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...
2
by: Manish | last post by:
Hey folks I am having a weird problem in ASP .Net. My page is in C#. I have a datagrid, which populates based on selection in drop down box on ASP page. This datagrid has template textbox colum in...
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...
7
by: Sandy | last post by:
Hello - I have a form that when submitted checks the database and if the username is already taken, a label shows indicating same. I need to make that label NOT visible after the user clicks...
1
by: jason | last post by:
I've seen a few posts on this issue, but no clear solutions. I have a mulitiline textbox inside a datagrid. I use TemplateColumn to define as multiline with 3 rows. I have other field types...
2
by: Eric Diana | last post by:
Hello, Im trying to create a dynamic array of textboxes from an array returned by a web service. THe web service returns a list of fields that I need to place on a dynamically created web page....
22
by: Tim | last post by:
Hi A while ago I got some help in writing a mock console. The idea was to write a VB app that contained a textbox, then run a process from within the app and redirect the stdout to the textbox. ...
3
by: Rebekkah | last post by:
I did a search but couldn't find a question similar to mine. I need to count the values in a textbox on a report and have the count subtotal in a group footer. But I need three different counts on...
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: 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: 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
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
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...
0
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,...

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.