0
void Form1::textBox9_KeyPress(System::Object^  sender, System::Windows::Forms::KeyPressEventArgs^  e)
{
	if(!Char::IsDigit(e->KeyChar) && (e->KeyChar != 0x08))
        e->Handled = true;
}

Thats the code i got, but, how could i allow CTRL+V.

if(Char::IsDigit(e->KeyChar))
    return;
    if(e->KeyChar=='\b')
    return;
    if(e->KeyChar=='\v')
    return;
    if(e->KeyChar=='CTRL')
    return;
    e->Handled=true;

This also doesn't work ._.

(Im using Visual Studio 2010)

Edited by Danny1994: n/a

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Danny1994
0

If you enter ^v or backspace, you can display the integer value of the keys to find out what to compare the key value to.

0

Could anyone post code snippet, please ?

I tryed much differnt things, but they all didnt worked.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.