必要条件:一个属性,2个事件
Code
public UccFormChat() {
InitializeComponent();
this.chatView.InitControl();
InitializeViewEvent();
this.ribbonControl1.QAT.Hidden = true;
this.DoubleBuffered = true;
this.AllowDrop = true;
this.DragEnter += new DragEventHandler(UccFormChat_DragEnter);
this.DragDrop += new DragEventHandler(_OutputBox_DragDrop);
}
void UccFormChat_DragEnter(object sender, DragEventArgs e) {
e.Effect = DragDropEffects.Copy;
}
void _OutputBox_DragDrop(object sender, DragEventArgs e) {
foreach (string file in ((System.Array)e.Data.GetData(DataFormats.FileDrop))) {
MessageBox.Show(file);
}
}
posted @
2009-06-26 14:50
何翔华
阅读(
339)
评论()
编辑
收藏
举报