2012年7月3日

Silverlight 拖动复制控件

摘要: Silverlight 拖动复制控件,就是将控件从一个容器中向另一个容器中拖动时,不是移动控件而把该控件到另一个容器中。这种情形在程序中经常遇到,下面是我做的一个拖动复制控件的示例,仅供有这种需求的朋友们参考。 新建一个 Silverlight 项目命名为 DragAndCopy ,在新建的项目中添加一个Silverlight 用户控件(Silverlight user control)命名为 DragObject。项目结构如下图所示: 其中 DragObject 就是要拖动的用户控件,DragObject 的 Xaml 代码如下:<UserControl x:Class="D 阅读全文

posted @ 2012-07-03 22:54 项目管理之家 阅读(599) 评论(0) 推荐(0) 编辑

C#实现简单的拖动功能

摘要: 这个例子是将系统文件或目录拖动到窗体中,窗体以MessageBox的形式弹出用户拖入的文件或目录名称。首先需要将要支持拖动的Form的AllowDrop=true;然后通过DragEnter和DragDrop事件即可,具体代码如下: 1 private void Form1_DragDrop(object sender, DragEventArgs e) 2 { 3 System.Array datas = (System.Array)e.Data.GetData(DataFormats.FileDrop); 4 string ... 阅读全文

posted @ 2012-07-03 22:51 项目管理之家 阅读(373) 评论(0) 推荐(0) 编辑

Silverlight 开源项目分析Live Geometry CTP 2(2)项目框架分析

摘要: Silverlight 开源项目分析Live Geometry CTP 2(2)项目框架分析在线地址:http://geometry.osenkov.com源码地址:http://livegeometry.codeplex.com/没看懂Live Geometry只好自己摸索了。大气象<UserControlx:Class="SilverlightUndo.DrawDrag"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://sc 阅读全文

posted @ 2012-07-03 22:43 项目管理之家 阅读(503) 评论(0) 推荐(0) 编辑

Silverlight对象拖动总结

摘要: Silverlight对象拖动总结 在Silverlight中,要实现拖动对象的功能最简单的方式是采用Canvas做为父容器,通过动态的改变元素的附加属性Top、Left即可实现拖动同能。如图所示:下例所示: XAML:<UserControl x:Class="DragExample.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xam 阅读全文

posted @ 2012-07-03 22:40 项目管理之家 阅读(1331) 评论(0) 推荐(0) 编辑

导航