随笔分类 -  winform

摘要:public static class Ex{ public static T2 Map< T2>(this object t1) where T2 : class { var t1_Pinfos = t1.GetType().GetProperties(); var t2_Pinfos = typ 阅读全文
posted @ 2021-11-12 15:54 212的s 阅读(35) 评论(0) 推荐(0)
摘要:nuget 安装 DataMatrix.net //示例 DmtxImageEncoder Die = new DmtxImageEncoder(); DataMatrix.net.DmtxImageEncoderOptions option = new DmtxImageEncoderOption 阅读全文
posted @ 2021-11-12 15:54 212的s 阅读(237) 评论(0) 推荐(0)
摘要://调用方式 var frm = new MyForm().Instance(); public static class ExFrm { static Dictionary<string, Form> forms = new Dictionary<string, Form>(); /// <sum 阅读全文
posted @ 2021-11-12 15:53 212的s 阅读(30) 评论(0) 推荐(0)
摘要:public static double MillimeterToPixel_X(double length) //length是毫米,1厘米=10毫米 { System.Windows.Forms.Panel p = new System.Windows.Forms.Panel(); System 阅读全文
posted @ 2021-11-12 15:48 212的s 阅读(247) 评论(0) 推荐(0)
摘要://具体打包过程,参考下面网址 https://www.cnblogs.com/dongh/p/6868638.html VS 扩展和更新-联机 搜索 Microsoft Visual Studio Installer Projects 安装后可以创建打包项目,把文件添加进去,然后生成,得到一个安装 阅读全文
posted @ 2021-11-12 15:46 212的s 阅读(427) 评论(0) 推荐(0)
摘要://引用 System.IO.Compression.FileSystem.dll var basePath = AppDomain.CurrentDomain.BaseDirectory; System.IO.Compression.ZipFile.CreateFromDirectory(base 阅读全文
posted @ 2021-11-12 15:43 212的s 阅读(43) 评论(0) 推荐(0)
摘要:保存: Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath); if (config.AppSettings.Settings.AllKeys.Contains("ke 阅读全文
posted @ 2021-11-12 15:42 212的s 阅读(480) 评论(0) 推荐(0)
摘要:OpenFileDialog控件的基本属性InitialDirectory:对话框的初始目录 Filter: 获取或设置当前文件名筛选器字符串,例如,"文本文件(*.txt)|*.txt|所有文件(*.*)||*.*" FilterIndex 在对话框中选择的文件筛选器的索引,如果选第一项就设为1 阅读全文
posted @ 2021-11-12 15:40 212的s 阅读(73) 评论(0) 推荐(0)
摘要:public static float GetDpiX() { System.Windows.Forms.Panel p = new System.Windows.Forms.Panel(); System.Drawing.Graphics g = System.Drawing.Graphics.F 阅读全文
posted @ 2021-11-12 15:39 212的s 阅读(181) 评论(0) 推荐(0)
摘要:public static string ExportAOrder(ExportData data) { var cellHeard = new Dictionary<string, string> { { "sort","序号"}, { "modeName","型号名称"}, { "modeCod 阅读全文
posted @ 2021-11-12 15:38 212的s 阅读(69) 评论(0) 推荐(0)
摘要:richTextBox1.Select(index, "str1".Length); richTextBox1.SelectionColor = Color.Red; 阅读全文
posted @ 2021-11-12 15:34 212的s 阅读(407) 评论(0) 推荐(0)
摘要:graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; 阅读全文
posted @ 2021-11-12 15:28 212的s 阅读(347) 评论(0) 推荐(0)
摘要:public Bitmap ResizeImage(Bitmap bmp, int newW, int newH,int dpi) { var b = new Bitmap(newW, newH); b.SetResolution(dpi,dpi);//设置DPI var g = Graphics. 阅读全文
posted @ 2021-11-12 15:17 212的s 阅读(128) 评论(0) 推荐(0)
摘要://image 可以先转换为 bitmap Bitmap bmp = new Bitmap(width, height); bmp.SetResolution(300, 300); 阅读全文
posted @ 2021-11-12 15:16 212的s 阅读(149) 评论(0) 推荐(0)
摘要:Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; Graphics.SmoothingMode = System.Drawing.Drawing2D.Smoothin 阅读全文
posted @ 2021-11-12 15:09 212的s 阅读(541) 评论(0) 推荐(0)
摘要://设置自动换行 dgv.DefaultCellStyle.WrapMode = DataGridViewTriState.True; //设置自动调整高度 dgv.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; 阅读全文
posted @ 2021-11-12 14:52 212的s 阅读(60) 评论(0) 推荐(0)