C#-窗体之间传递参数

主窗体:

            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;

}

 

你可能感兴趣的:(传递参数)