随笔分类 -  C#

摘要:实现效果: 知识运用: 窗体的WindowState属性 和FormBorderStyle属性 实现代码: 阅读全文

posted @ 2018-12-15 14:29 努力成长静待花开 阅读(258) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: MouseMove事件 ImageAlign属性 //获取或设置按钮控件上的图像对其方式 //默认为MiddleCenter 属性值为ContentAlignment枚举值之一 实现代码: 阅读全文

posted @ 2018-12-15 14:08 努力成长静待花开 阅读(171) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: TreeView控件及其ExpandAll方法 实现代码: 阅读全文

posted @ 2018-12-15 12:00 努力成长静待花开 阅读(172) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: Timer组件的Start方法 窗体的FormBorderStyle属性 补充:属性为FixedToolWindow枚举值的窗体通常不显示在任务栏中 但是必须确保ShowInTaskbar属性设置为false 因为其默认值为true 实现代码: 阅读全文

posted @ 2018-12-15 11:24 努力成长静待花开 阅读(752) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: API函数AnimateWindows [DllImportAttribute("user32.dll")] private static extern bool AnimateWindow(IntPtr hwnd,int dwTime,int dwFlags); 实现代码: 阅读全文

posted @ 2018-12-14 21:42 努力成长静待花开 阅读(270) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: Timer组件 Lable控件的Left属性 实现代码: 阅读全文

posted @ 2018-12-14 20:37 努力成长静待花开 阅读(182) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: API函数SetWindowLong和GetWindowLong 在调用API函数的时候要添加 System.Runtime.InteropService命令空间 [DllImport("user32", EntryPoint = "GetWindowLong")] //从指 阅读全文

posted @ 2018-12-14 19:52 努力成长静待花开 阅读(245) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: Random类的Next方法 窗体的BackgroundImage属性 random类的next方法用来返回一个小于所指定最大值的非负随机数 public virtual int Next(int maxValue) //maxValue:要生成的随机数上限(随机数不能取该上 阅读全文

posted @ 2018-12-13 23:01 努力成长静待花开 阅读(217) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: 窗体的Opacity属性 用来获取或设置窗体的不透明度级别 public double Opacity{ get; set; } 属性值:窗体的不透明度级别默认为1.00 透明为0 实现代码: 阅读全文

posted @ 2018-12-13 22:07 努力成长静待花开 阅读(339) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: Anchor属性 用来获取或设置控件绑定到容器的边缘 并确定控件如何随其父级一起调整大小 public virtual AnchorStyle Anchor{get; set;} //属性值为 AnchorStyles枚举值的按位组合 默认是Top和Left 阅读全文

posted @ 2018-12-13 00:27 努力成长静待花开 阅读(271) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: 重写窗体的OnPint方法 对窗体进行重绘 最后设置透明色 实习代码: 阅读全文

posted @ 2018-12-12 23:48 努力成长静待花开 阅读(197) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: 通过重写窗体的OnPaint方法 在其中对窗体进行重绘 并使用透明色将窗体设置为透明来实现 OnPaint方法: 用来从新绘制窗体图像 protected override void OnPaint(PaintEventArgs e) //painteventargs为Pai 阅读全文

posted @ 2018-12-12 23:23 努力成长静待花开 阅读(121) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: Button控件的BackColor FlatStyle和TextImageRelation属性 BackColor属性 用来获取或设置控件的背景色 //属性值为一个表是背景色的Color值 FlayStyle属性 获取或设置按钮控件的平面样式外观 //属性值为FlatSty 阅读全文

posted @ 2018-12-12 21:24 努力成长静待花开 阅读(442) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: Button控件的SendToBack方法 和ListView控件的Items.Add方法 public void SendToBack() //将控件发送到Z顺序的后面 ListView控件的Items属性用来获取控件中所有项的集合 其Add方法用来将项添加到ListVie 阅读全文

posted @ 2018-12-12 13:35 努力成长静待花开 阅读(338) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: MenuStri控件和ToolStrip控件的AllowItemRecorder属性 实现是否由该类独自处理拖放和项项的重新排序 public bool AllowItemReorder{get; set;} 在移动菜单栏和工具栏时 需按住Alt键 同时用鼠标拖动 ToolS 阅读全文

posted @ 2018-12-12 00:23 努力成长静待花开 阅读(264) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: Graphics对象的Clear方法 位于System.Drawing命名空间下 他封装一个GDI+绘图界面 其Clear方法用来清除整个绘图 并以指定背景色填充 public void Clear(Color color) 实现代码: 阅读全文

posted @ 2018-12-11 20:49 努力成长静待花开 阅读(278) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: 窗体的BackgroundImage和BackgroundImageLayout属性 public virtual Image BackgroundImage{get; set;} //属性值 一个Image图像 public virtual ImageLayout Back 阅读全文

posted @ 2018-12-11 20:26 努力成长静待花开 阅读(838) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: 用到了API函数的FlashWindow [System.Runtime.InteropServices.DllImportAttribute("user32_.dll")] public static extern bool FlashWindow(IntPtr handl 阅读全文

posted @ 2018-12-11 13:51 努力成长静待花开 阅读(388) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: 将窗体的Text属性设置为空 同时将ControlBox属性设置为False 实现代码: 阅读全文

posted @ 2018-12-11 13:19 努力成长静待花开 阅读(136) 评论(0) 推荐(0)

摘要:实现效果: 知识运用: 将窗体的FormBorderStyle属性设置为FormBorderStyle.FixedDialog枚举值实现 实现代码: 阅读全文

posted @ 2018-12-10 23:19 努力成长静待花开 阅读(165) 评论(0) 推荐(0)