private void Btn_Contact_Click(object sender, EventArgs e) { ComposeForm cfrm = new ComposeForm(); cfrm.username = Lbl_UN.Text; cfrm.ShowDialog(); }
private void DGV_CellClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow row = this.DGV.Rows[e.RowIndex]; Comm.Connection = Conn; Comm.CommandType = CommandType.StoredProcedure; Comm.CommandText = "Sp_ReadMsgs"; Conn.Open(); Comm.Parameters.AddWithValue("@Msg_ID", row.Cells["Msg_ID"].Value.ToString()); Msg_ID = Convert.ToInt32(row.Cells["Msg_ID"].Value.ToString()); Comm.ExecuteNonQuery(); ComposeForm cfrm = new ComposeForm(); cfrm.Txt_Title.Text = row.Cells["Title"].Value.ToString(); cfrm.Txt_Msg.Text = row.Cells["Msg"].Value.ToString(); cfrm.ShowDialog(); }