Click here to Skip to main content
15,905,875 members

Comments by George_Rasmi (Top 26 by date)

George_Rasmi 5-Oct-11 3:07am View    
it happens randomly !
George_Rasmi 2-Oct-11 12:20pm View    
it didn't help :(
George_Rasmi 2-Oct-11 12:20pm View    
I did that too, but it's not the problem because when I test the program I always write something in the text box
George_Rasmi 2-Oct-11 12:16pm View    
you have to write a text in the PrivateMessageTextBox and press Enter to add this text to the PrivateRichTextBox1 ... the code of the PrivateMessageTextBox key_up (Enter) event is this:

private void PrivateMessageTextBox_KeyUp_1(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
PrivateMessageTextBox.Text = PrivateMessageTextBox.Text.Replace("\r\n", "");
if (PrivateMessageTextBox.Text != "")
{
try
{
PrivateRichTextBox1.Text = PrivateRichTextBox1.Text + "Me: " + PrivateMessageTextBox.Text + "\n";
PrivateRichTextBox1.SelectionStart = PrivateRichTextBox1.Text.Length;
PrivateRichTextBox1.ScrollToCaret();
}
catch
{
}
PrivateMessageTextBox.Text = "";
}
}
}
}

but to get that error you will have to execute this function very fast and for many times (I mean try to write one character and then press enter then immediately re write a character and press enter and keep doing this very fast and for many times until the program stops and gives you that error)
George_Rasmi 28-Sep-11 16:10pm View    
it worked Thanks :)