在Visual Basic 6中删除所有对象的焦点 [英] Removing focus from all objects in Visual Basic 6
问题描述
将焦点设置到表单本身不起作用。
我想到做旧的隐藏一个占位符后面的另一个对象的窍门,但我真的不是一个粉丝。
谢谢!
在VB6中,一个 PictureBox
可以获得焦点,即使它不包含任何控制。 在你的情况下,你可以把 PictureBox
和 TabStop
false, BorderStyle
设置为0, TabIndex
设置为0,但不包含任何可调焦在运行时通过 ScaleHeight
控制并扩展到 ScaleWidth
。
你必须在这个背景中放置标签和任何无窗口的控件 PictureBox
。
当用户点击表单时,焦点将消失。使用无焦点 Is there a method such that a user can click on the form itself, and in doing so remove focus from whatever object (textbox, combobox, etc) currently has it? Basically, can focus be uniformly removed from everything at once? Setting the focus to the form itself does not work. I thought about doing the old "hide a placeholder button behind another object" trick, but I'm really not a fan of that. Thanks! In VB6 a In your case you can put a You have to put the labels and any windowless control in this background This way when the user clicks "on the form" the focus will "go away". With "no focus" 这篇关于在Visual Basic 6中删除所有对象的焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! Tab键键将会把第一个控件(使用
TabIndex
设置为1的控件)关闭。 > PictureBox
can get focus, even if it does not contain any control.PictureBox
with TabStop
false, BorderStyle
set to 0, TabIndex
set to 0 behind every other control but not containing any focusable control and stretch it to ScaleWidth
by ScaleHeight
at run-time.PictureBox
too.Tab
key will focus first control (the one with TabIndex
set to 1).