全面掌握C#中的拖放操作
http://www.uncj.net/news/show.aspx?id=60
http://www.uncj.net/news/show.aspx?id=60
解决方案 »
- GMap.net的问题,很奇怪
- 急,急,在本机上个人邮件服务器的安装问题??
- 一个 comboBox 里面没有邦定任何值 ,如何对它作判断啊!(即判断它里面有没有值)
- 关于视频文件播放、保护的问题
- 求救~WINFORM中,已打开窗体A,B,注意都是show(),不是showdialog()
- 在DataGrid中,怎麼將設的關聯的父子表的數據顯示在一層!(C#)
- winform界面设计问题
- 高分求使用 Sql Server 2000操作图片对象的例子?
- 请教一种流程
- 关于 未处理的“System.StackOverflowException”类型的异常
- 最近使用文档问题
- 我的调试错误(请你看看)
两个treeview之间:
http://www.syncfusion.com/FAQ/WinForms/FAQ_c91c.asp
也没有背景出现在鼠标所在的结点上,其实这个被选中的节点不是当前
鼠标所在的结点,这就造成托动不能达到预其的效果,是怎么回事呢有在一个控件上treeview托动的参考代码吗,要不我把我的代码给贴出来。
{
//获得进行"Drag"操作中拖动的字符串
string dummy = "temp";
string s =( string )e.Data.GetData(dummy.GetType());
s = s.Substring(s.IndexOf( ":" )+ 1).Trim();
Point Position=new Point(0,0);
Position.X = e.X;
Position.Y = e.Y;
Position=treeView1.PointToClient(Position);
TreeNode DropNode=this.treeView1.GetNodeAt(Position);
//在目标组件中加入以此字符串为标题的项目
if(DropNode!=null)
{
TreeNode DragNode=new TreeNode(s);
treeView1.Nodes.Insert(DropNode.Index+1,DragNode);
}
} private void treeView1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
{
if(e.Data.GetDataPresent(DataFormats.Text ))
{
e.Effect =DragDropEffects.Move;
}
else
{
e.Effect =DragDropEffects.None ;
}
} private void treeView1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
{
string strItem=e.Item.ToString ();
this.treeView1.DoDragDrop (strItem,System.Windows.Forms.DragDropEffects.Move );
}