简体   繁体   English

通过用户控制最小化表单

[英]Minimize Form by user control

I have a user control that has three buttons on top Close , Minimize and On Top. 我有一个用户控件,该控件顶部有三个按钮:关闭,最小化和顶部。 When we drag that user control on windows form application and run it we can perform all three functionalities. 当我们在Windows窗体应用程序上拖动该用户控件并运行它时,我们可以执行所有三个功能。 But when i made my own user control and added these options only close could be added by implementing Application.Exit(); 但是当我创建自己的用户控件并添加这些选项时,只能通过实现Application.Exit();添加close Application.Exit(); but not topmost or minimize as they require form so how can we minimize the form by the usercontrol button 但不是最顶层或最小化,因为它们需要表单,因此如何通过用户控件按钮最小化表单

在UserControl中,您具有ParentForm属性,该属性可以让您执行所需的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM