博客园  :: 首页  :: 新随笔  :: 联系 :: 管理

2009年7月22日

摘要: private void menuStepAdd_Click(object sender, EventArgs e){ frmAddStep addStep = new frmAddStep(); addStep.FormBorderStyle = FormBorderStyle.None; addStep.TopLevel = false; splitMain.Panel2.Controls.Add(addStep); addStep.Show();}//"不显示"tabControl1的tabPage2 this.tabControl1.TabPages.Remove( 阅读全文

posted @ 2009-07-22 22:45 codingsilence 阅读(421) 评论(0) 推荐(0) 编辑

摘要: string strIniFile = System.Windows.Forms.Application.StartupPath + “//setting.ini” 阅读全文

posted @ 2009-07-22 22:40 codingsilence 阅读(225) 评论(0) 推荐(0) 编辑

摘要: 在WebForm中,可以使用反射将业务对象绑定到 ASP.NET 窗体控件。最近做Winform项目,也参考WebForm中的代码实现同样的功能。 Winform没有提供类似WebForm中的FindControl方法,我于是用遍历控件的方式,写了一个类似WebForm中的这个方法,考虑到Winform中的很多控件放在Label、TabControl中,方法采用了递归的方式。 Winform和Winform的控件也有些区别,如在Winform中,DateTimePicker取值是用Value属性,在WebForm中使用SelectDate属性,在Winform中,有NumericUpDown控 阅读全文

posted @ 2009-07-22 22:39 codingsilence 阅读(239) 评论(0) 推荐(0) 编辑

摘要: 方法一:只禁止多个进程运行[STAThread]public static void Main(){bool ret;System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out ret);if (ret){ System.Windows.Forms.Application.EnableVisualStyles(); //这两行实现 XP 可视风格System.Windows.Forms.Application.DoEvents();System.Windows.Form 阅读全文

posted @ 2009-07-22 22:36 codingsilence 阅读(450) 评论(0) 推荐(0) 编辑

摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Web;usingSystem.Web.Caching;usingSystem.Threading;namespaceNPao.Tools.EntityDesign{publicclassCacheConfig{privatestaticHttpRuntime_httpRuntime;publicstaticCacheCache{get{EnsureHttpRuntime();returnHttpRuntime.Cache;}}privatestat 阅读全文

posted @ 2009-07-22 22:33 codingsilence 阅读(160) 评论(0) 推荐(0) 编辑

摘要: 先定义一个热键类using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.Windows.Forms;namespace ExcelReportDesigner{ class WinHotKey { public WinHotKey() { } //如果函数执行成功,返回值不为0。 //如果函数执行失败,返回值为0。要得到扩展错误信息,调用GetLastError。 [DllImport("user32.dll&qu 阅读全文

posted @ 2009-07-22 22:20 codingsilence 阅读(185) 评论(0) 推荐(0) 编辑