摘要: 写Winform程序的时候,有将一个窗口放置到特定的显示器,并且全屏的需求。于是借此机会,好好研究了一番这个Screen类[1],总结了一些方法。 Windows的窗口逻辑 首先我们需要知道窗口定位的逻辑。以2个窗口为例,下面的图片展示了显示器和坐标的对应关系。注意,使用深色模式可能看不清,可以点击 阅读全文
posted @ 2024-07-10 19:01 东经115 阅读(2) 评论(0) 推荐(0) 编辑
摘要: public class TestEditor { private static TestEditor instance; private static readonly object syncRoot = new object(); public static TestEditor GetInst 阅读全文
posted @ 2024-07-05 21:03 东经115 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 定义接口中事件和接口参数 namespace ImplementInterfaceEvents { public interface IDrawingObject { event EventHandler ShapeChanged; } public class MyEventArgs : Even 阅读全文
posted @ 2024-07-05 08:35 东经115 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 导入“本地资源”的图片,会在Form文件下面的Form.resx文件里面,不可以在多个Form界面引用,不可以在里面修改图片的名称; 导入“项目资源文件”的图片,会保存在Properties文件夹下面的Resources.resx文件夹里面,可以在多个form界面引用,可以在里面修改图片的名称。 注 阅读全文
posted @ 2024-07-03 08:55 东经115 阅读(3) 评论(0) 推荐(0) 编辑
摘要: var query = collection.GroupBy(x => x.title).Select(y => y.FirstOrDefault()); 是不是很简单呢? 阅读全文
posted @ 2024-04-28 21:41 东经115 阅读(2) 评论(0) 推荐(0) 编辑
摘要: GridControl下UseEmbeddedNavigator = True; 阅读全文
posted @ 2024-04-09 13:24 东经115 阅读(6) 评论(0) 推荐(0) 编辑
摘要: private void AutoStart(bool isAuto = true, bool showinfo = true) { try { if (isAuto == true) { RegistryKey R_local = Registry.CurrentUser;//RegistryKe 阅读全文
posted @ 2024-02-18 17:41 东经115 阅读(27) 评论(0) 推荐(1) 编辑
摘要: 比如要显示性别为字符串,数据库中保存为数值(1:男,2:女,3:未知)。 点击"Run Designer"按钮,进入设计界面。添加GridView1的事件CustomColumnDisplayText private void gridView1_CustomColumnDisplayText(ob 阅读全文
posted @ 2024-01-09 20:34 东经115 阅读(29) 评论(0) 推荐(0) 编辑
摘要: Options 选项 OptionsBehavior 视图的行为选项 AllowAddRows 允许添加新数据行 AllowDeleteRows 允许删除数据行 AllowIncrementalSearch 允许用户通过输入想得到的列值来定位行 AllowPartialRedrawOnScrolli 阅读全文
posted @ 2024-01-01 10:45 东经115 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 首先开启GridView的属性: view.OptionsClipboard.AllowCopy = DefaultBoolean.True; //允许复制 view.OptionsClipboard.CopyColumnHeaders = DefaultBoolean.False; //是否复制表 阅读全文
posted @ 2023-12-12 09:41 东经115 阅读(101) 评论(0) 推荐(0) 编辑