无面板继承的类面板控件 [英] Panel-like control without panel inheritance

查看:50
本文介绍了无面板继承的类面板控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道面板和tabcontrol控件如何允许用户将控件拖放到它们上,我想构建类似的东西,但是找不到任何有用的东西.
继承面板或tabcontrol类是我不想做的事情,我真的很想知道拖放与设计器如何工作.

另外,我想用C#做到这一点.

预先感谢,
Nbgangsta

I was wondering about how the panel and tabcontrol controls allow the user to drag and drop controls onto them, I''m want to build something alike but can''t find anything of use.
Inheriting the panel or tabcontrol class is something I don''t want to do, I really want to know how the drag and drop works with the designer.

Also, I''d like to do this with C#.

Thanks in advance,
Nbgangsta

推荐答案

它们处理各种拖动事件:

DragEnter
DragLeave
DragDrop
DragOver
ItemDrag
GiveFeedback

您可以在所需的任何控件上处理这些事件.这是一个不错的链接:

http://www.c-sharpcorner.com/uploadfile/mgold/doingdraganddropusingcsharp11302005020610am/doingdraganddropusingcsharp.aspx /a> [ ^ ]
They handle the various drag events:

DragEnter
DragLeave
DragDrop
DragOver
ItemDrag
GiveFeedback

You can handle those events on any control you want. Here''s a decent link:

http://www.c-sharpcorner.com/uploadfile/mgold/doingdraganddropusingcsharp11302005020610am/doingdraganddropusingcsharp.aspx[^]


这篇关于无面板继承的类面板控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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