
WinForm
文章平均质量分 50
笔记
chengyu0726
这个作者很懒,什么都没留下…
展开
-
WinForm 将配置文件内容写入下拉框中
1. 设置配置文件App.config 中添加 appSettings 节点内容<?xml version="1.0" encoding="utf-8" ?><configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> </startup> <appSettings>原创 2021-01-28 18:44:58 · 626 阅读 · 1 评论 -
WinForm 常用控件
1.按钮控件【Button】1.1 属性(F4)Text:页面显示内容Name:后台通过Name属性获取该控件对象Anchor:是否随主窗体变动(上、下、左、右可固定)BackColor:背景色BackgroundImage:背景图片BackgroundImageLayout:背景图片布局 Zoom:居中 Stretch:全填充ContextMenuStrip:右键菜单&原创 2021-01-23 15:21:17 · 932 阅读 · 0 评论 -
WinForm 对话框【Dialog】
种类OpenFileDialog:打开文件对话框SavaFileDialog:保存文件对话框FontDialog:字体对话框ColorDialog:颜色选择对话框应用点击【选择文件】按钮,将选取的文件内容写到文本框中private void button1_Click(object sender, EventArgs e){ // 弹出对话框 OpenFileDialog o = new OpenFileDialog(); // 标题 o.Title原创 2021-01-09 12:34:50 · 1448 阅读 · 0 评论 -
WinForm GDI绘图
1. 画直线点击按钮,画一条直线private void button1_Click(object sender, EventArgs e){ // 创建GDI对象 Graphics gr = this.CreateGraphics(); // 创建画笔对象 Pen pen = new Pen(Brushes.Red); // 创建两点 Point p1 = new Point(10,10); Point p2 = new Point(100,原创 2021-01-09 12:34:14 · 1498 阅读 · 0 评论 -
WinForm MDI窗体设计(含菜单控件【MenuStrip】)
介绍原创 2021-01-04 19:11:14 · 2240 阅读 · 0 评论