.NET自定义控件设计时帮助 [英] .NET Custom Control Design-Time help

查看:97
本文介绍了.NET自定义控件设计时帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究在网上找到的自定义控件,我想为其添加设计时功能,以便在左上角显示一个小图标,以使控件的移动更加容易.现在,有时无法移动控件,因为鼠标光标似乎不想正确抓住它.

我指的是类似于GroupBox控件的功能.添加后,您会看到一个类似+的小符号,单击该符号可以选择要在设计器上移动的控件.

我如何在我的自定义控件中添加这样的内容?

I''m working on hacking a custom control I found online, and I''d like to add design-time functionality to it such that a small icon appears in the top left to make it easier to move the control. Right now, there are times when moving the control just doesn''t work because the mouse cursor doesn''t seem to want to grab onto it properly.

What i''m referring to is functionality similar to the GroupBox control. When it is added, you can see a small + like symbol that when clicked on, selects the control to be moved on the designer.

How can i add something like this to my custom control?

推荐答案

agent154写道:
agent154 wrote:

-鼠标光标似乎不想正确抓住它.

—mouse cursor doesn''t seem to want to grab onto it properly.

这称为拟人化,是 trope 的一种,请参阅 http://en.wikipedia.org/wiki/Trope_%28linguistics%29 [ ^ ]. (由于某种原因,英语Wikipedia页面中缺少这种变音符,但可以使用许多其他语言.)

尽管这种观察非常有趣,但以我的拙见,科学方法在技术上仍然更具生产力,请参阅 ^ ].

好的,这些非常概论供您使用. :-)现在,您需要进一步详细介绍. :-)

您描述得不够详细的实现设计时行为的问题并不是很困难.您需要计划好工作计划并相应地实施,但是如果遇到无法解决的问题,请尝试详细描述问题和预期行为,并创建一些尝试的简短代码示例.在这种情况下,我们很乐意为您提供帮助.

—SA

This is called personification, one of the kinds of trope, please see http://en.wikipedia.org/wiki/Trope_%28linguistics%29[^]. (By some reason, this very kind of trope is missing from English Wikipedia page, but it is available in many other languages.)

Even though this observation is very interesting, in my humble opinion, the scientific method is still more productive in technology, please see http://en.wikipedia.org/wiki/Scientific_method[^].

OK, these were very general ideas for you to utilize. :-) Now, you need to go in further detail. :-)

The problem of implementing of the design-time behavior which you described in insufficient detail is not extremely difficult. You need to plan you work thoroughly and implement accordingly, but if you face some problem you cannot solve, try to describe the problem and expected behavior in detail and create some short code sample you tried. In this case, we would gladly help you.

—SA


这篇关于.NET自定义控件设计时帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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