Visual Studio Designer-在容器内选择控件 [英] Visual Studio designer - selecting control inside container

查看:129
本文介绍了Visual Studio Designer-在容器内选择控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很显然,Google今天不是我的朋友.所有参考似乎都是关于代码的,而不是设计者本身.

我正在与一些第三方控件一起工作,他们迫切希望您在设计器中单击它们以设置某些属性,等等.作为一个老派的编码员,我习惯于编写实际的代码,所以我不没有太多与设计师的经验.

我有放置在面板,表格等内部的控件.我需要选择单个控件.但是,设计人员只将重点放在容器本身上.尝试了ctrl单击,shift单击等明显的排列,但没有乐趣.

那么,如何将焦点放在一个包含的控件上,以便随后单击它的小属性/菜单选项卡?

所有这些年来学习编码的时间都是浪费的.显然,我应该花更多的时间在鼠标上.

Clearly, Google is not my friend today. All references seem to come up about code, not the designer itself.

I''m working with some third party controls, and they reeeeeally want you to click on them in the designer to set certain properties, etc. As an old school coder, I''m used to writing the actual code, so I don''t have much experience with the designer.

I have controls that are placed inside panels, tables, etc. I need to select the individual controls. However, the designer gives focus only to the container itself. Tried the obvious permutations of ctrl click, shift click, etc. but no joy.

So, how do you give focus to a contained control so that can then click the little properties / menu tab for it?

All those years learning to code were wasted. Clearly I should have spent more time with the mouse.

推荐答案

右键单击会在光标下方显示所有控件的列表-应该在此处列出.当然,这就是我用于Split容器等的地方,单击仅选择面板,而不是容器.

或者,使用属性"窗格顶部的下拉菜单-这会按字母顺序列出表单中的所有控件.
Right click brings up a list of all the controls below the cursor - it should be listed there. Certainly, that is what I use for Split containers and so forth, where a click only selects the panel, not the container.

Alternatively, use the drop down at the top of the Properties pane - this lists all the controls in the form in alphabetical order.


大多数控件没有设计器菜单,但那些菜单为我工作.可通过属性"控件访问大多数属性.不应将所有控件都放在[i]上,而是可以在设计器"窗口中选择,它们具有明显的视觉提示(例如,显示移动/调整大小的手柄).你知道区别吗?

如果看不到它,则好像您的Visual Studio安装搞砸了.如果是这样,请尝试重新安装.



聚焦细节.每个控件都可以是可聚焦的或不可聚焦的.当它可以聚焦时,它可以得到聚焦-每个(弹出)窗口(例如.NET窗口或Form)仅一个控件.集中表示接受键盘输入事件.通常,控件会显示视觉提示(按钮的虚线矩形,文本框中的文本光标,特殊颜色等).这与不依赖键盘并执行当前"概念的选择不同.例如,ListBox可以被聚焦但不能被选中,但是列表框项目可以被选择但不被聚焦.可以选择多个对象,但只能选择一个.也无法取消聚焦:您只能通过聚焦于其他事物或停用所有者窗口/表单来改变焦点.当所有者窗口/窗体被激活时,该控件实际上是焦点,但是当激活时,先前焦点所在的控件将获得焦点,因此可以说是虚拟焦点"(WPF具有虚拟焦点的层次结构系统,而不是窗体).焦点受Tab/Shift + Tab导航和调用Control.Focus方法的影响.

现在,就像Designed是编辑器一样,它使用选择的概念而不是焦点.如果选择组件,则将填充属性"窗口,并显示位置/大小手柄和可视提示.您可以选择多个组件并一起编辑/移动.

—SA
Most of the controls do not have designer menus, but those which have work for me. Most properties are accessible via the Properties control. All the controls are not supposed to be focused they can be selected in the Designer windows, with apparent visual clue (showing move/resize handles, for example). Do you know the difference?

If you don''t see it, it would look like you Visual Studio installation screwed up. If so, try to reinstall it.



Details of focusing. Each control can be focusable or not. When it is focusable, it can get focus — only one control per (pop-up) windows, such as and .NET Window or Form. Focused means accepting keyboard input events. Usually controls show a visual clue (dotted rectangle for buttons, text cursor in text boxes, special color, etc.). This is not the same as selection which does not depend on keyboard and conduct the idea of ''current''. For example, ListBox can be focused but not selected, but list box item can me selected but not focused. Several objects can be selected but only one focused; it''s also impossible to un-focus: you can only change focus by focusing on something else or de-activate the owner window/form. The control is actually focuses when the owner window/form is activated, but when activate, the previously focused control gets focus, so one can speak of "virtual focus" (WPF has hierarchical system of virtual focusing, but not Forms). The focusing is affected by Tab/Shift+Tab navigation and calling Control.Focus method.

Now, as Designed is the editor, it uses the concept of selection instead of focus. If you select a component, is populate the Properties windows and show position/size handle and a visual clue. You can select more than one components and edit/move together.

—SA


这篇关于Visual Studio Designer-在容器内选择控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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