导航

随笔分类 -  WinForm常用操作

摘要:1.新建一个UserControl用户控件,代码如下: 2.将用户控件拖入某个窗体,打开窗体设计界面如下: 3.开始运行后的窗体如下: 经过对比,上述代码可以解决处在设计模式下的窗体,指定或者禁用某一部分代码的运行 阅读全文

posted @ 2018-01-31 11:33 清浅ヾ

摘要:(1) KeyPress 和KeyDown 、KeyUp之间的区别: 1).KeyPress主要用来捕获数字(注意:包括Shift+数字的符号)、字母(注意:包括大小写)、小键盘等除了F1-12、SHIFT、Alt、Ctrl、Insert、Home、PgUp、Delete、End、PgDn、Scro 阅读全文

posted @ 2018-01-30 11:22 清浅ヾ

摘要://注册绑定事件 private void dgvBidFile_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { DataGridView dataGridView = (DataGridView)sen... 阅读全文

posted @ 2018-01-30 10:56 清浅ヾ

摘要:private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if(Char.IsDigit(e.KeyChar) || e.KeyChar.ToString() =="." || e.KeyChar == 8) { //Indic... 阅读全文

posted @ 2017-12-13 11:13 清浅ヾ

摘要:具体的消息表示: 1. WM_PAINT消息,LOWORD(lParam)是客户区的宽,HIWORD(lParam)是客户区的高 2. 滚动条WM_VSCROLL或WM_HSCROLL消息,LOWORD(wParam)指出了鼠标对滚动条的操作。比如上、下、左、右、翻页、移动等。 3. 击键消息,有W 阅读全文

posted @ 2017-12-04 10:55 清浅ヾ

摘要:在Winform环境下DevExpress标题栏皮肤 第一步:引用DLL文件,安装DevExpress后在引用>程序集>扩展: DevExpress.BonusSkins.v12.2.dll DevExpress.Utils.v12.2.dll 第二步:应用程序的主入口点注册代码 //下面是注册皮肤 阅读全文

posted @ 2017-12-03 21:13 清浅ヾ

摘要:WM_CREATE 0x0001 应用程序创建一个窗口 WM_DESTROY 0x0002 一个窗口被销毁 WM_MOVE 0x0003 移动一个窗口 WM_SIZE 0x0005 改变一个窗口的大小 WM_ACTIVATE 0x0006 一个窗口被激活或失去激活状态 WM_SETFOCUS 0x0 阅读全文

posted @ 2017-12-01 09:18 清浅ヾ

摘要://1.获取模块的完整路径。 string path1 = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; //2.获取和设置当前目录(该进程从中启动的目录)的完全限定目录 string path2 = System.Environment.CurrentDirectory; //3.获取... 阅读全文

posted @ 2017-11-28 14:17 清浅ヾ

摘要:简单了解一下ActiveX控件的知识,ActiveX控件:简单来说,就是利用封装性的原理,把一些功能封装起来,我们可以再其他程序中使用,进而达到方便的目的。但是要注意ActiveX控件必须要注册后才可以使用。 我们打开VX2010编译器(右键->以管理员方式运行,稍后会解释原因),选择MFC->MF 阅读全文

posted @ 2017-11-17 11:22 清浅ヾ

摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication... 阅读全文

posted @ 2017-11-13 00:07 清浅ヾ

摘要:using Microsoft.Win32; RegistryKey key = Registry.LocalMachine; RegistryKey soft = key.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true); soft.SetValue("Shell", "explorer.e... 阅读全文

posted @ 2017-10-31 15:28 清浅ヾ

摘要:汉化ok和cnacel: //调用: if (DialogBox.Confirm("是否开始设置")==DialogResult.OK) { } else { } 阅读全文

posted @ 2017-10-27 14:40 清浅ヾ

摘要:using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using DevExpress.XtraTab; nam... 阅读全文

posted @ 2017-10-23 17:12 清浅ヾ

摘要:0.设置窗体样式 引用CSKin.dll文件,继承的Form类父窗体可以改为继承该dll文件的其它窗体,如继承: Skin_Color,Skin_DevExpress,Skin_Mac,Skin_Metro,Skin_VS,(需引用 using CCWin;) 可以将CSkin.dll拖到新建的工具 阅读全文

posted @ 2017-10-16 17:25 清浅ヾ