i have this code, when i dynamically create a textbox....
i have this for a generic event handler (ie multiple texboxes use this event)Code:txt.KeyUp += new System.Windows.Forms.KeyEventHandler(txt_KeyUp);
however, when i use it, it doesnt send and clear the textbox, nor does it raise an exceptionCode:private void txt_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { TextBox txtbox = (TextBox)sender; try { if(e.KeyValue.ToString() == "13") { if (txtbox.Text != "") { connection.Sender.PublicMessage(txtbox.Tag.ToString(), txtbox.Text); txtbox.Text = ""; } } } catch( Exception e1 ) { rtfStatusOut.Text = "\n" + e1; } }
any ideas on what it could be?




Reply With Quote