随笔分类 -  WinForm

摘要:问题描述: FlowLayoutPanel 在win10可以鼠标滚轮 上下滚动图片,在win7却不行。 原因: FlowLayoutPanel默认不支持鼠标滚轮MouseWheel事件,在win10系统中,win10可以自动设置FlowLayoutPanel的焦点,实现滚轮滚动效果。win7不能自动 阅读全文
posted @ 2024-10-11 18:20 KevinSteven 阅读(132) 评论(0) 推荐(0)
摘要:/// <summary> /// 除去指定区域水印 /// </summary> /// <param name="sourceImagePath"></param> /// <param name="outputImagePath"></param> public static void Rem 阅读全文
posted @ 2024-06-15 15:43 KevinSteven 阅读(43) 评论(0) 推荐(0)
摘要:使用NuGet程序包下载安装 O2S.Components.PDFRender4NET.dll using O2S.Components.PDFRender4NET; //引用 O2S.Components.PDFRender4NET.dll /// <summary> /// PDF转JPEG / 阅读全文
posted @ 2024-06-15 15:42 KevinSteven 阅读(58) 评论(0) 推荐(0)
摘要:在使用WinForm编写测试小软件的时候,经常需要把数值通过Textbox显示出来。通常的做法为把改变后的数值显示在textbox上重新显示,需要通过数值重新赋值给相应的textbox.text属性才可显示。这个方法虽然很简单,但是在数值多的时候,这个做法非常麻烦而且不容易维护。那么有没有一种简单的 阅读全文
posted @ 2023-08-22 16:04 KevinSteven 阅读(542) 评论(0) 推荐(0)
摘要:一,窗体加载事件的顺序一般来说分为三个事件:1,Load 2,shown 3,VisibleChanged这三个事件。这三个事件根据我执行的顺序来看,Load首先加载,shown其次,最后是visiblechanged这个事件。//程序启动时候的顺序//第一个执行private void Form1 阅读全文
posted @ 2023-08-22 15:36 KevinSteven 阅读(1323) 评论(0) 推荐(0)
摘要:winform怎么优化(卡顿、启动慢、无响应) 1. 延迟加载:将不必要的界面元素和控件延迟加载,只有在需要时才加载。 2. 资源压缩:压缩和优化图片、css、js等资源文件,提高资源加载速度。 3. 异步加载:对于需要读取数据库或网络请求的操作,使用异步加载,避免阻塞主线程。 4. 控件优化:尽量 阅读全文
posted @ 2023-08-22 14:44 KevinSteven 阅读(882) 评论(1) 推荐(0)
摘要:public void AddRootNode() { tv_SystemTree.Nodes.Clear(); foreach (Model_SoftSystem item in softSystem.GetSoftSystemList()) { TreeNode rootNode = tv_Sy 阅读全文
posted @ 2022-03-30 14:46 KevinSteven 阅读(48) 评论(0) 推荐(0)
摘要:public override List<ModelParent> GetList(int pageIndex, int pageLength, string keyword, int id, ref int DataCount) { DataList = Code.BLLInterface.Get 阅读全文
posted @ 2022-02-28 15:21 KevinSteven 阅读(364) 评论(0) 推荐(0)
摘要:DataList = Code.BLLInterface.GetList(new Model_ProgramRequest(), FilePath, new Model_ProgramRequest().ClassName); List<Model_ProgramRequest> list = Da 阅读全文
posted @ 2022-02-28 15:17 KevinSteven 阅读(257) 评论(0) 推荐(0)
摘要://使用ConfigTool自动创建ini配置文件,保存系统配置参数。新建的文件保存在相对路径Config文件夹下。没有Config文件夹,需要手动创建文件夹,或是系统自动创建文件夹 public static bool bSortByDeviceName { get { return Tool.C 阅读全文
posted @ 2022-02-28 15:09 KevinSteven 阅读(734) 评论(0) 推荐(0)
摘要:/// <summary> /// 创建Conifg文件夹 /// </summary> public static void CreadConfigFile() { try { string path = Application.StartupPath + "\\Config"; if (!Fil 阅读全文
posted @ 2022-02-28 15:03 KevinSteven 阅读(444) 评论(0) 推荐(0)
摘要:数据写入XML public static void WriteXML<T>(List<T> overview, string path) { FileInfo fInfo = new FileInfo(path); if (!fInfo.Directory.Exists) { fInfo.Dire 阅读全文
posted @ 2022-02-28 15:01 KevinSteven 阅读(309) 评论(0) 推荐(0)
摘要:private bool flag1 = true; private string ImgClosePath = Application.StartupPath.Replace("\\bin\\Debug", "\\Image") + "\\gaitubao_close_png.png"; //图片 阅读全文
posted @ 2022-02-28 14:54 KevinSteven 阅读(194) 评论(0) 推荐(0)
摘要:全屏最大化代码: this.WindowState = System.Windows.Forms.FormWindowState.Maximized; 缩小最小化: this.WindowState = System.Windows.Forms.FormWindowState.Minimized; 阅读全文
posted @ 2022-02-28 14:42 KevinSteven 阅读(834) 评论(0) 推荐(0)