随笔分类 -  .Net-WinForm

摘要:// 以下示例为:模拟点击按钮的示例(执行按钮点击事件) button1.PerformClick(); // 模拟点击button1 阅读全文
posted @ 2023-10-31 14:10 ꧁执笔小白꧂ 阅读(173) 评论(0) 推荐(0) 编辑
摘要:有框 略(有两种,一种写法与无框原理相同;一种用MDIParent作为父窗体) 无框 form1.TopLevel = false; // 漏出菜单栏 form1.FormBorderStyle = FormBorderStyle.None; // 无框 form1.Parent = this.pa 阅读全文
posted @ 2023-10-31 14:06 ꧁执笔小白꧂ 阅读(115) 评论(0) 推荐(0) 编辑
摘要:事实证明,有些东西不用就会弄混。 阅读全文
posted @ 2023-04-25 21:26 ꧁执笔小白꧂ 阅读(273) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 监听手动关闭事件 /// </summary> /// <param name="msg"></param> protected override void WndProc(ref Message msg) { const int WM_SYSCOMMAND = 阅读全文
posted @ 2023-04-19 14:10 ꧁执笔小白꧂ 阅读(224) 评论(0) 推荐(0) 编辑
摘要:DirectoryEntry rootfolder = new DirectoryEntry("IIS://localhost/W3SVC/1/ROOT"); // IIS://服务器的名字/要操作的Web服务器类型/站点/站点的虚拟目录 1、创建对象: 2、修改对象: #region 1、利用Di 阅读全文
posted @ 2023-04-14 09:28 ꧁执笔小白꧂ 阅读(168) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing.Drawing2D; using System.Drawing; using System.Linq; 阅读全文
posted @ 2023-04-11 21:28 ꧁执笔小白꧂ 阅读(283) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing.Drawing2D; using System.Drawing; using System.Linq; 阅读全文
posted @ 2023-04-11 21:24 ꧁执笔小白꧂ 阅读(109) 评论(0) 推荐(0) 编辑
摘要:// 自定义控件(ToolStripButton) public partial class RoundButton : ToolStripButton { protected override void OnPaint(PaintEventArgs pevent) // 重写绘制 { base.O 阅读全文
posted @ 2023-03-20 13:27 ꧁执笔小白꧂ 阅读(186) 评论(0) 推荐(0) 编辑
摘要:// 找活动状态中的窗口 Form form = Form.ActiveForm.FindForm(); Console.WriteLine("ActiveForm.FindForm:" + form.GetType()); // 找应用中的窗口 FormCollection formCollect 阅读全文
posted @ 2023-03-16 09:18 ꧁执笔小白꧂ 阅读(170) 评论(0) 推荐(0) 编辑
摘要:1、窗体界面拖拽一个notifyIcon控件: 2、窗体启动时加载图标: /// <summary> /// 初次启动 /// </summary> private void Form1_Load(object sender, EventArgs e) { //显示托盘图标 notifyIcon1. 阅读全文
posted @ 2023-03-15 13:24 ꧁执笔小白꧂ 阅读(883) 评论(0) 推荐(0) 编辑
摘要:TextBox滑动条保持在最后一行 private void TextBox_TextChanged(object sender, System.EventArgs e) { this.TextBox.SelectionStart = this.TextBox.Text.Length; this.T 阅读全文
posted @ 2023-03-11 16:51 ꧁执笔小白꧂ 阅读(141) 评论(0) 推荐(0) 编辑
摘要:由Windows默认处理的消息就调用Windows的DefWindowProc; 这里的WndProc就是对应控件窗口的窗口过程,而DefWndProc会被WndProc调用,处理那些WndProc中未处理的消息(包括WndProc未吞掉的); 因此DefWndProc收到的消息会比WndProc少 阅读全文
posted @ 2022-12-06 09:23 ꧁执笔小白꧂ 阅读(265) 评论(0) 推荐(0) 编辑
摘要:static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetC 阅读全文
posted @ 2022-10-27 16:21 ꧁执笔小白꧂ 阅读(102) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 只能输入数字 /// </summary> private void txt1_KeyPress(object sender, KeyPressEventArgs e) { //如果输入的不是退格和数字,则屏蔽输入 if (!(e.KeyChar == 8 || 阅读全文
posted @ 2022-01-05 17:37 ꧁执笔小白꧂ 阅读(132) 评论(0) 推荐(0) 编辑
摘要:1 /// <summary> 2 /// 不重复运行程序 3 /// </summary> 4 /// <returns></returns> 5 private static Process RunningInstance() 6 { 7 Process current = Process.Ge 阅读全文
posted @ 2021-12-27 16:25 ꧁执笔小白꧂ 阅读(103) 评论(0) 推荐(0) 编辑
摘要:if (dataGridView1.Rows[0].Cells[0].Value == DBNull.Value) { //... } 阅读全文
posted @ 2021-12-27 09:58 ꧁执笔小白꧂ 阅读(194) 评论(0) 推荐(0) 编辑
摘要:最新版下载地址: https://www.慧都evget.com/product/740/download 图摘自:https://blog.csdn.net/luzhangtong/article/details/81177616 DexExpress12.2.5 链接:https://pan.b 阅读全文
posted @ 2021-10-19 10:49 ꧁执笔小白꧂ 阅读(481) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 重写Panel-还未实现圆角功能 /// </summary> public class RoundPanel : Panel { private int mMatrixRound = 8; private Color mBack; public Color Ba 阅读全文
posted @ 2021-08-12 14:38 ꧁执笔小白꧂ 阅读(195) 评论(0) 推荐(0) 编辑
摘要:#region DropDownList样式重绘 /// <summary> /// 主要为DropDownList样式重绘(特定性较强) /// </summary> public partial class ComboboxEx : ComboBox { public ComboboxEx() 阅读全文
posted @ 2021-08-12 14:36 ꧁执笔小白꧂ 阅读(552) 评论(0) 推荐(0) 编辑
摘要:#region Form圆角 public void SetWindowRegion() { System.Drawing.Drawing2D.GraphicsPath FormPath; FormPath = new System.Drawing.Drawing2D.GraphicsPath(); 阅读全文
posted @ 2021-08-11 11:08 ꧁执笔小白꧂ 阅读(987) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示