如何在vb.net中创建一个cancelbutton类 [英] How to make a cancelbutton class in vb.net

查看:54
本文介绍了如何在vb.net中创建一个cancelbutton类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我用于设置表单属性的代码

This is my code for set the form properties

Imports System.Windows.Forms.Form
Public Class formProperties
    Public Sub FormProperty(ByRef myForm As System.Windows.Forms.Form)
        myForm.SuspendLayout()
        myForm.Text = "BLA BLA BLA"
        myForm.StartPosition = FormStartPosition.CenterScreen
        myForm.ShowInTaskbar = False
        myForm.MaximizeBox = False
        myForm.MinimizeBox = False
        myForm.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedSingle
    End Sub
End Class



这段代码就是我使用此类的方式



and this code is how i use this class

Dim myf As formProperties = New formProperties
    myf.FormProperty(Form2)
    Form2.ShowDialog()



如果要按表单中的转义键,我想制作一个..它将隐藏或关闭表单...
但我不知道...
有人可以帮我解决这个问题吗?...

thx



I want to make if i press escape key in the form..it will be hide or close the form...
but i haven''t idea...
can anybody help me to fix this problems....

thx

推荐答案

转义键应该就是这样做的.如果不是,请处理KeyPressed事件
The escape key should just do that. If not, handle the KeyPressed event


您能告诉我解决我的问题的代码吗? thx
can you show me the code for fix my problem chris....
thx


这篇关于如何在vb.net中创建一个cancelbutton类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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