Passing variables from main form to input form

前端 未结 3 1222
清歌不尽
清歌不尽 2020-12-22 12:15

I have a simple question. I have a main form, and then a startup form from where I can select a new 3D model to generate. When selecting a new 3D model from the startup form

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-22 12:22

    Add a public property on your main form

    public bool IsDirty
    {
        get;set;
    }
    

    you can then access this.ParentForm.IsDirty in your startup form,

    remember to pass a reference to the main form when you show the startup form ... startupForm.showDialog(this);

提交回复
热议问题