04 2024 档案

c# 桌面程序配置存储类
摘要:public static class SettingHelper { private static string getConfigPath() { var configFilePath = AppDomain.CurrentDomain.SetupInformation.Configuratio 阅读全文

posted @ 2024-04-10 12:32 空明流光 阅读(19) 评论(0) 推荐(0) 编辑

c# 测量字体文字大小
摘要:示例1: var g = label1.CreateGraphics(); var size = g.MeasureString(label1.Text, label1.Font); label2.Height = (int)size.Height; 示例2: int textHeight = Te 阅读全文

posted @ 2024-04-09 17:55 空明流光 阅读(119) 评论(0) 推荐(0) 编辑

c# winform 让一个无边框窗口可调整大小
摘要:窗体被控件完全覆盖,完全无法响应鼠标事件。 其中参数 container 传 this.container 即可,是为了资源能优雅释放做准备用的。 用如下代码: public static class FormResizer { [System.Runtime.InteropServices.Dll 阅读全文

posted @ 2024-04-09 07:19 空明流光 阅读(501) 评论(0) 推荐(0) 编辑

c# 窗体截图
摘要:/// <summary> /// 可以捕获超出屏幕大小的的截图 /// </summary> /// <param name="hWnd"></param> /// <returns></returns> public static Image CaptureWindowScreen(IntPtr 阅读全文

posted @ 2024-04-02 14:39 空明流光 阅读(99) 评论(0) 推荐(0) 编辑

如何为自己的应用创建一个 progId?
摘要:If you plan to associate one or more file types with a new application, you must define a ProgID for each file type that you want to associate with th 阅读全文

posted @ 2024-04-02 09:40 空明流光 阅读(33) 评论(0) 推荐(0) 编辑

winform 加载 element-ui 并显示图标
摘要:var elementFonts = new PrivateFontCollection(); elementFonts.AddFontFile(Application.StartupPath + "\\Fonts\\element-icons.ttf"); var elementIconFont 阅读全文

posted @ 2024-04-01 23:12 空明流光 阅读(59) 评论(0) 推荐(0) 编辑

c# 自绘图标
摘要://绘制一个下拉菜单按钮 private void drawMenuFlag(int lineWidth, PictureBox picture) { // 创建一个与 PictureBox 大小相同的 Bitmap Bitmap bmp = new Bitmap(picture.Width, pi 阅读全文

posted @ 2024-04-01 13:03 空明流光 阅读(59) 评论(0) 推荐(0) 编辑

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示