Click here to Skip to main content
15,903,362 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: very simple question : Pin
Mark Salsbery27-Jun-07 12:13
Mark Salsbery27-Jun-07 12:13 
QuestionSTL Pin
tom groezer27-Jun-07 7:48
tom groezer27-Jun-07 7:48 
AnswerRe: STL Pin
Christian Graus27-Jun-07 11:32
protectorChristian Graus27-Jun-07 11:32 
QuestionTextbox Difficult Pin
mikobi27-Jun-07 3:54
mikobi27-Jun-07 3:54 
AnswerRe: Textbox Difficult Pin
Christian Graus27-Jun-07 12:20
protectorChristian Graus27-Jun-07 12:20 
GeneralRe: Textbox Difficult Pin
mikobi27-Jun-07 21:04
mikobi27-Jun-07 21:04 
GeneralRe: Textbox Difficult Pin
mikobi28-Jun-07 22:02
mikobi28-Jun-07 22:02 
GeneralRe: Textbox Difficult Pin
mikobi3-Jul-07 6:42
mikobi3-Jul-07 6:42 
This Solution to my problem

// Boolean flag used to determine when a character other than a number is entered.
private:
bool nonNumberEntered;

// Handle the KeyDown event to determine the type of character entered into the control.
void textBox1_KeyDown( Object^ /*sender*/, System::Windows::Forms::KeyEventArgs^ e )
{
// Initialize the flag to false.
nonNumberEntered = false;

// Determine whether the keystroke is a number from the top of the keyboard.
if ( e->KeyCode < Keys::D0 || e->KeyCode > Keys::D9 )
{
// Determine whether the keystroke is a number from the keypad.
if ( e->KeyCode < Keys::NumPad0 || e->KeyCode > Keys::NumPad9 )
{
// Determine whether the keystroke is a backspace.
if ( e->KeyCode != Keys::Back )
{
// A non-numerical keystroke was pressed.
// Set the flag to true and evaluate in KeyPress event.
nonNumberEntered = true;
}
}
}
}

// This event occurs after the KeyDown event and can be used to prevent
// characters from entering the control.
void textBox1_KeyPress( Object^ /*sender*/, System::Windows::Forms::KeyPressEventArgs^ e )
{
// Check for the flag being set in the KeyDown event.
if ( nonNumberEntered == true )
{ // Stop the character from being entered into the control since it is non-numerical.
e->Handled = true;
}
}
Questiondeterministic cleanup in C++/CLI Pin
rockonedge26-Jun-07 21:48
rockonedge26-Jun-07 21:48 
AnswerRe: deterministic cleanup in C++/CLI Pin
Geo Pa27-Jun-07 3:52
Geo Pa27-Jun-07 3:52 
Questionbyte C# to C++ Pin
C#Coudou26-Jun-07 19:22
C#Coudou26-Jun-07 19:22 
AnswerRe: byte C# to C++ Pin
C#Coudou26-Jun-07 19:39
C#Coudou26-Jun-07 19:39 
QuestionNetwork speed detection Pin
C#Coudou26-Jun-07 18:36
C#Coudou26-Jun-07 18:36 
AnswerRe: Network speed detection Pin
Paul Conrad14-Jul-07 13:41
professionalPaul Conrad14-Jul-07 13:41 
QuestionConnectionString Pin
mikobi26-Jun-07 4:53
mikobi26-Jun-07 4:53 
AnswerRe: ConnectionString Pin
led mike26-Jun-07 5:26
led mike26-Jun-07 5:26 
AnswerRe: ConnectionString Pin
Mark Salsbery26-Jun-07 5:55
Mark Salsbery26-Jun-07 5:55 
GeneralRe: ConnectionString Pin
mikobi27-Jun-07 5:37
mikobi27-Jun-07 5:37 
GeneralRe: ConnectionString Pin
Mark Salsbery27-Jun-07 6:35
Mark Salsbery27-Jun-07 6:35 
GeneralRe: ConnectionString Pin
mikobi27-Jun-07 21:06
mikobi27-Jun-07 21:06 
QuestionQuery with parameters Pin
mikobi26-Jun-07 3:36
mikobi26-Jun-07 3:36 
AnswerRe: Query with parameters Pin
mikobi27-Jun-07 5:34
mikobi27-Jun-07 5:34 
QuestionMVPs Pin
vibindia25-Jun-07 18:11
vibindia25-Jun-07 18:11 
AnswerRe: MVPs Pin
Giorgi Dalakishvili25-Jun-07 20:35
mentorGiorgi Dalakishvili25-Jun-07 20:35 
AnswerRe: MVPs Pin
Mark Salsbery25-Jun-07 20:45
Mark Salsbery25-Jun-07 20:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.