文章分类 - 控件拖拽,自定义控件
winform wpf 控件拖拽
摘要:1 效果 这里要注意的是要设置 TextBlock 允许拖拽 Canvs 接收拖拽 2 代码操作 2.1 、 新建一个用户控件 uNodeA.xaml <Grid> <Grid.RowDefinitions> <RowDefinition /> </Grid.RowDefinitions> <Sta
阅读全文
摘要:1 效果 2 代码 /// <summary> /// 开关样式 /// </summary> public enum SwitchStyle { style1 = 0, style2 = 1, style3 = 2, style4 = 3, style5 = 4, style6 = 5 }; pu
阅读全文
摘要:1 效果如 2 代码编写 public partial class UPanel : Panel { public UPanel() { InitializeComponent(); } private Color bgColor = Color.Gray; /// <summary> /// 背景
阅读全文
摘要:1 效果 2 代码展示 public partial class ULightControl : Control { public ULightControl() { InitializeComponent(); SetStyle(ControlStyles.Selectable,true); Se
阅读全文
摘要:1 效果图 2 代码编写 /// <summary> /// 水桶 /// </summary> public partial class UCWaterTank : UserControl { public UCWaterTank() { InitializeComponent(); this.S
阅读全文
摘要:1 水管流动的方向,粗细 2 、代码编写 public partial class UCPipe : UserControl { public UCPipe() { InitializeComponent(); this.SetStyle(ControlStyles.AllPaintingInWmP
阅读全文
摘要:1 、效果 2 代码编写 /// <summary> /// 报警器 前台页面不用做任何设置 /// </summary> public partial class UCAlarmControl : UserControl { public UCAlarmControl() { Initialize
阅读全文
摘要:1、效果图,向左,向右,向上,向下 设置参数 2 、代码编写 public partial class UArrowControl : UserControl { /// <summary> /// 报警灯颜色 /// </summary> private Color arrowColor = Co
阅读全文
摘要:1 、效果如 设置值参考 2 、代码编码 新建一个用户控件,前台页面不用做任何设置 /// <summary> /// 仪表盘 /// </summary> public partial class InstrumentControl : UserControl { public Instrumen
阅读全文
摘要:1 、效果如图 2 代码编写 A 、 前台页面 新建一个前台页面 Insrunment.xaml <Grid> <Ellipse Fill="{Binding PlateBackground, RelativeSource={ RelativeSource AncestorType=UserCont
阅读全文
摘要:1 效果展示,双击节点可以新的页面进行操作 2 代码编写 1、新建一个流程节点用户控件,2个lable 控件组成,如果要lable 可以搞改变大小可以将AutoSize设置为false 后台代码: public partial class FlowNode : UserControl { /// <
阅读全文

浙公网安备 33010602011771号