主窗体:
string getroomtypeid = this.dgvroomtype.Rows[e.RowIndex].Cells[0].Value.ToString(); AddRoomTypeFrm AddRoomTypeFrm = new AddRoomTypeFrm(getroomtypeid); AddRoomTypeFrm.Show();
子窗体
public AddRoomTypeFrm(string getroomtypeid) { InitializeComponent(); string id = getroomtypeid; }