sourav adhikary

sourav adhikary

  • NA
  • 69
  • 21.4k

Message Box Problem Please Help!!

Mar 4 2019 11:28 PM
Hello Guys!!!
My problem is if i run Code with Messagebox it will work fine but if I Run code after comment messagebox line it will not display or not working as expected...
 
Thanks in advanced
 
string mess = txtChatBox.Text.Remove(txtChatBox.Text.LastIndexOf(Environment.NewLine));
int newM = mess.LastIndexOf("\n");
if (newM == -1)
{
mes.Close(); 
mes = new frmMessage(mess.Substring(0, mess.Length));
mes.Show();
//MessageBox.Show("Not Working");
}
else
{
mes.Close();
mes = new frmMessage(mess.Substring(newM + 1, (mess.Length - newM) - 1));
mes.Show();
MessageBox.Show("Working");
txtMessage.Text = "";
txtMessage.Focus();
}
 

Answers (5)