在苹果酒中拖拽 [英] Drag Drop in Cider

查看:65
本文介绍了在苹果酒中拖拽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力增强我们的控件在设计器中的行为方式。我们有一些自定义版本的组合框,文本框等。我们还有一个标签控件。我想做的是以下任何一种:

1.当我在文本框顶部拖出一个标签时,它会与该文本框相关联。
2.当我拖出一个文本框,标签也会被添加到容器中。

I am working on enhancing the way our controls behave within the designer.  We have some customized versions of combobox, textbox, etc.  We also have a label control.  What I would like to do is either of the following:

1.  When I drag out a label on top of a textbox, it gets associated with that text box.
2.  When I drag out a text box, a label also gets added to the container.

推荐答案

你看过我们的可扩展性部分?您可以使用DefaultInitializer为文本框类完成2)。我们在某些情况下使用它来创建默认子项,但我认为我们没有尝试过这种方式创建兄弟姐妹。对于1),您可以尝试使用Parent / PlacementAdapters进行实验。诀窍仍然是让父容器处理两个项目的父母和位置。

上帝的运气。
Have you looked at our extensibility section on MSDN? You might be able to get 2) done using a DefaultInitializer for your text box class. We use it to create default children in some cases, but I don't think we have tried creating siblings this way. For 1), you could try experimenting with Parent/PlacementAdapters. The trick would be to still let the parent container handle the parenting and placement for both items though.

God luck.


这篇关于在苹果酒中拖拽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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