使用属性窗口来识别窗体上的控件
在窗体上选择一个控件后,“属性”窗口的最顶部会显示该控件的名称和类型,并且在下面的下拉菜单中会显示一个包含更多控件的列表。如果我单击其中一个列表项,它会选择表单上的该控件。
1)这个下拉菜单的正确名称是什么?
2) 什么决定哪些控件出现在下拉列表中?
3)如何使任何给定的控件出现在下拉列表中?即在一个非常繁忙的表格上,我知道我在某个地方有一定的控制权,但我看不到它。我想在下拉菜单中选择它,这样它就会知道它的位置,但我不知道如何在该菜单上获取它。
With a control selected on a form, at the very top of the Properties Window the name and type of the control are displayed, and on the dropdown menu underneath there's a list with some more controls. If I click on one of the list items, it selects that control on the form.
1) What is the proper name for this dropdown menu?
2) What determines which controls appear on the dropdown list?
3) How can I make any given control appear on the dropdown list? i.e. on a very busy form, I know I have a certain control on there somewhere but I can't see it. I'd like to select it on the dropdown menu so it will make its location known, but I don't know how to get it on that menu.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将其称为“属性窗口”下拉菜单。控件似乎以分层/概述的方式显示,尽管并不总是直观的。
例如,我将引用一个带有框架、多页和命令按钮控件的表单,我将其称为“顶级”控件。
控件选择有两种级别:一种是控件以浅色点画为边界,另一种是以深色散列标记为边界。我将第一个称为“激活”,将第二个称为“选择”。您可以通过按 Tab 键或在“属性窗口”下拉列表中选择该控件来“激活”该控件。您可以通过按 Tab 键选择它,然后单击 Enter,或者单击其边框内部来“选择”它。 (如果您通过在属性窗口下拉列表中选择控件来激活该控件,则单击 Enter 将不会选择它。)
当您第一次选择用户窗体时,它将显示在下拉列表中。单击下拉列表时,会列出三个顶级控件。如果您通过在下拉列表中选择多页来激活它,您的下拉选项将不会改变。如果您选择多页(如上所述),则多页当前是活动页面,并且将列出该页面上的控件。 UserForm 本身不会被列出。如果您以相同的方式选择框架,您将得到类似的结果:将列出框架及其顶级控件,而不会列出用户窗体。
我认为导航复杂表单的最佳方法是使用 Tab 键。如果您选择了表单并开始使用选项卡,您将循环浏览所有顶级控件。单击 Enter 将带您“进入”控件。如果该控件有子控件(例如,多页),您可以使用 Tab 键浏览它们。在没有子控件的控件上按 Enter 键将使您进入该控件的编辑模式。例如,在激活命令按钮的情况下按 Enter 键将使您进入字幕编辑模式。
如果您位于具有子控件(例如框架)的“内部”,则可以通过选项卡浏览子控件。一旦您通过选项卡浏览了所有子控件,单击选项卡将使您返回一个级别,例如,将选择命令按钮。
请注意,您还可以通过按 Esc 键“退出”到下一个级别。因此,如果您处于按钮的编辑模式,Esc 将使您返回到仅选择该按钮。如果您选择了框架内的控件,则 Esc 将选择该框架。多次按 Esc 将使您返回到选择表单本身的根级别。
在你的问题促使我进行调查之前,我不知道其中大部分内容,所以感谢您帮助我学习!这是一个令人困惑的话题,所以我希望我的写作能有点清晰。
I'd call it the Property Windows dropdown. It seems the controls are displayed in a hierarchical/outlined manner, although not always an intuitive one.
For example, I’ll refer to a form with a Frame, a Multipage and a Commandbutton control, which I’ll call the “top-level” controls.
There are two levels of control selection: one where the control is bordered by light stipples, and another where it’s bordered by dark hash marks. I call the first “activating” and the second “selecting.” You can “activate” a control by tabbing to it, or by choosing it in the Property Windows dropdown. You can “select” it by tabbing to it and then clicking Enter, or by clicking just inside its border. (If you activate a control by choosing it in the Property Windows dropdown, clicking Enter won’t select it.)
When you first select the Userform it will show in the dropdown. When you click the dropdown list the three top-level controls are listed. If you activate the Multipage by choosing it in the dropdown your dropdown choices won’t change. If you select the Multipage (as described above) the Multipage, it’s currently active Page and the controls on that Page will be listed. The UserForm itself will not be listed. If you select the Frame in the same manner you’ll have similar results: the Frame and its top-level controls will be listed and the UserForm won’t be listed.
I think the best way to navigate a complex form is by tabbing. If you have the form selected and start to tab, you’ll cycle through all the top-level controls. Clicking Enter takes you “into” the control. If that control has sub-controls (e.g., the Multipage) you can then tab through them. Hitting Enter on a control that doesn’t have sub-controls puts you in edit mode for that control. For example, hitting Enter with a Commandbutton activated puts you in caption edit mode.
If you’re “inside” a control with sub-controls, such as the Frame, you can then tab through the sub-controls. Once you’ve tabbed through all the sub-controls, clicking Tab will take you back up a level, e.g., the Commandbutton will be selected.
Note that you can also “back out” to the next level up by hitting the Esc key. So if you’re in edit mode on the button, Esc will take you back to just selecting the button. If you’ve selected a control inside the frame, Esc will select the Frame. Hitting Esc multiple times takes you back to the root level where the form itself is selected.
I didn’t know most of this until your question sparked me to investigate, so thanks for helping me learn! It’s a confusing topic, so I hope my writing is somewhat clear.
解决OP的项目符号
属性窗口下拉菜单的正确名称是什么?
对象框
<块引用>
对象框列出了当前选定的对象。仅对象来自
活动形式可见。如果选择多个对象,属性
对象及其设置的共同点,基于所选的第一个对象,
显示在“属性列表”选项卡上。
来源:属性窗口 UI 帮助
或者也许是属性对象框,以区别于代码对象框
<块引用>
对象框是位于左上角的列表框
列出了代码所在的窗体和窗体中的控件的窗口
已附加,或位于属性窗口顶部的列表框
列出了表单及其控件。
来源:VBE 术语表< /a>
什么决定哪些控件出现在下拉列表中?
<块引用>
示例:用户表单、框架和工作表
如何使任何给定的控件出现在下拉列表中?
接受答案的纠正时间点
这是不准确的:
具有焦点的窗口是接收击键的窗口;或者使用答案中的术语,属性窗口必须获得焦点,然后才能“激活”控件和对象窗口 必须先获得焦点,然后才能“选择”活动控件。
使用 Shift F7 的窗口,以便它接收击键命令
“选择”活动控件。
处理拥挤的表格
如果你像我一样,那么你已经拆解了比你愿意承认的更多的表格,因为手指的抽动将一个控件埋在了邻居体内的某个地方;很可能是在你花了最后一个小时打磨的复杂巢穴中。
Top
/Left
/Z order
可能是找到它的最快方法。您可以按 F4 将焦点置于“属性窗口”,然后按 Ctrl + Shift + T 循环到顶部
(或 L 表示左侧
)Addressing the OP's Bullets
What is the proper name for Properties window dropdown menu?
The Object box
Or perhaps Properties Object box for differentiation from the Code Object box
What determines which controls appear on the dropdown list?
How can I make any given control appear on the dropdown list?
Point of Correction on the Accepted Answer
This is not accurate:
The window with focus is the window that receives the keystroke; or to use nomenclature from the answer, the Properties Window must have focus before it can "activate" a control and the Object Window must have focus before the active control can be "selected".
Window with Shift F7 so that it receives the keystroke command
to "select" the active control.
Coping with Crowded Forms
If you are like me, then you have disassembled more forms than you care to admit because a finger twitch buried a control somewhere inside a neighbor; likely in complex nest that you spent the last hour polishing.
Top
/Left
/Z order
may be the fastest way to find it. You can press F4 to set focus on the Properties Window and Ctrl + Shift + T to cycle toTop
(or L forLeft
)