关闭esc键上的Windows窗体时出现问题?

编程入门 行业动态 更新时间:2024-10-27 03:39:23
本文介绍了关闭esc键上的Windows窗体时出现问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的项目EXIT按钮中,包含的代码为me.close() 并将退出"按钮的名称"属性设置为cmdExit. 并将退出按钮"的对话框结果属性"设置为取消". 并将表单的CancelButton属性设置为cmdExit. 上面的代码有时仅适用于. Forms仅具有vb控件. 为什么它不起作用.还有其他解决方法. 请解决该问题.

In my project EXIT button is there which contained the code as me.close() and set Name property of the Exit button as cmdExit. and have set Dialog Result Property as of Exit Button as Cancel. And have set CancelButton Property of the form as cmdExit. Above code has worked for sometimes only. Forms has vb controles only. Why it is not working.Is there any other way to resolve it. Kindly solve it

推荐答案

我不明白您要尝试执行的操作,但是如果您要关闭任何表单,可以将此代码粘贴到Keypress事件中表格 如果Asc(e.KeyChar)= Keys.Escape然后 me.close() 如果结束 如果您需要更多帮助,请与我联系! :cool: I don''t get u''re trying to do but if u want close any form u can paste this code in the Keypress event of the form If Asc(e.KeyChar) = Keys.Escape Then me.close() End If If u need more help contact me! :cool:

更多推荐

关闭esc键上的Windows窗体时出现问题?

本文发布于:2023-11-11 16:55:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1579027.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗体   esc   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!