如何在menustrip中禁用最大化,最小化和关闭按钮 [英] How can i Disable Maximize,Minimize and close buton in menustrip

查看:130
本文介绍了如何在menustrip中禁用最大化,最小化和关闭按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨Frinds,

iam使用C#.Net Windows Application ..在我的项目中有不同的模块将由MDI使用..

现在问题是什么,我可以打开一个新形式的意思,在右上角,它们将在MDI和Menustrip中显示最大化,最小化和关闭的图标..

我想只显示MDI中的图标。可以从menustrip删除子窗体图标(最大化,最小化和关闭)

解决方案

试试这个

有一个名为MaximizeBox的属性,设置为false并且

另一个名为MinimizeBox的设置为false。



  private   const   int  CP_NOCLOSE_BUTTON = 0x200; 
受保护 覆盖 CreateParams CreateParams
{
get
{
CreateParams myCp = base .CreateParams;
myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;
return myCp;
}
}


嗨朋友们,

我解决了这个问题,在子表单加载事件中我已设置以下属性,

  .ControlBox = ; 
.MaximizeBox = false ;
.MinimizeBox = false ;



但是,即使你不能成功,也可以去FormName下面的设计师页面把这个,

 这个 .ControlBox =  false ; 
this .ShowIcon = false ;


Private Sub Form4_Resize(ByVal sender As Object,ByVal e As System.EventArgs)处理Me.Resize

如果Me.WindowState = FormWindowState.Minimized那么

Me.WindowState = FormWindowState.Normal

结束如果



End Sub


Hi Frinds,
iam using C#.Net Windows Application..In my project have different module that will be used by MDI..
now what the problem is,i can open a new form mean, in right top corner they will display icon as maximize,minimize and Close in both MDI and Menustrip..
I want to show only the icon in MDI..how can Remove child forms icons(Maximize,Minimize and Close) from menustrip

解决方案

try this
There is property named MaximizeBox, set it false and
another named MinimizeBox set it false.

private const int CP_NOCLOSE_BUTTON = 0x200;
protected override CreateParams CreateParams
{
    get
    {
       CreateParams myCp = base.CreateParams;
       myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON ;
       return myCp;
    }
}


Hi Friends,
I solved this problem,In the child form load event i have set the following properties,

this.ControlBox = false;
this.MaximizeBox = false;
this.MinimizeBox = false;


But, even-though you could not Success, go to the designer page under FormName put this,

this.ControlBox = false;
this.ShowIcon = false;


Private Sub Form4_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
End If

End Sub


这篇关于如何在menustrip中禁用最大化,最小化和关闭按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆