标题栏上的Closebox [英] Closebox on a caption bar

查看:187
本文介绍了标题栏上的Closebox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我如何使窗体的标题栏上的关闭框"被禁用,允许...我已经尝试过控制框,但这不是我想要的.有人可以帮忙吗?
感谢

hello,
how do i make the "closebox" on the caption bar of a form disabled allowing...I''ve tried control box but that isn''t what i want. could anyone help?
thanks

推荐答案



将此代码添加到表单中以禁用关闭按钮:
Hi,

add this code to your form to disable the close button:
Private Const CP_NOCLOSE_BUTTON As Integer = &H200
Protected Overrides ReadOnly Property CreateParams() As CreateParams
    Get
        Dim myCp As CreateParams = MyBase.CreateParams
        myCp.ClassStyle = myCp.ClassStyle Or CP_NOCLOSE_BUTTON
        Return myCp
    End Get
End Property


这篇关于标题栏上的Closebox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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