In the previous period of time to do wireless passive temperature measurement project, the production of pop-up frame ideas: all using. Show () to complete.
The problem is: Trigger once, pop a box, apparently not up to the requirements, and then pass through the form between the value,
After the form is first triggered, the condition mask is triggered until the popup box is destroyed and the trigger is turned on.
In fact, the popup box can be completely completed with. ShowDialog ().
However, this way when the pop-up box is not destroyed, you can not manipulate other content, applicable to the production of the Welcome page, about the page production and so on.
And the above mentioned aspect, can implement the popup box existence only one time, realizes to the other content operation, but the implementation is somewhat complex.
Essence: See the value of the form!
Pop-up box
1 Public Delegate voidOperate (BOOLFlag);//declaring a delegate2 PublicOperate Operate;//the instantiation of a delegate that controls the Enable property of the Open button that opens this form3 4 Private voidForm25_load (Objectsender, EventArgs e)5 {6 if(Operate! =NULL)7 {8Operatefalse);9 }Ten}
1 Private void Form25_formclosing (object sender, FormClosingEventArgs e)2{3if null)4{5 operate (true); 6 }7 }
Main form
1 Private voidTemperature offset Configuration Toolstripmenuitem_click (Objectsender, EventArgs e)2 {3Fr25 =NewFORM25 ();//Temperature Offset Configuration4Fr25.operate =set_ temperature offset configuration toolstripmenuitem_enable;5 Fr25. Show ();6Fr25.operate_wendupianyiliang =Operate_temperaturepianyiliang;7 }8 Private voidset_ Temperature Offset Configuration toolstripmenuitem_enable (BOOLflag)9 {Ten This. temperature offset Configuration toolstripmenuitem.enabled =Flag; One}
Main form pop-up box, experience summary