文章分类 -  控件拖拽,自定义控件

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