Process mobj_pro = Process.GetCurrentProcess(); Process[] mobj_proList = Process.GetProcessesByName(mobj_pro.ProcessName); if (mobj_proList.Length > 1 ) { MessageBox.Show("当前的应用程序已打开!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return; }
CustomerAdd pobj_CustomerAdd; Form pobj_CustomerAdd_Return = CheckIsExit( " CustomerAdd " ); if (pobj_CustomerAdd_Return == null ) { pobj_CustomerAdd=new CustomerAdd(); OpenSheet(pobj_CustomerAdd); } else { OpenSheet((CustomerAdd)pobj_CustomerAdd_Return); }
void OpenSheet(Form pobj_form) { pobj_form.MdiParent=this; pobj_form.Show(); } /**/ /// <summary> /// 判断窗口是否存在 /// </summary> /// <param name="ps_windowName">窗口的名称</param> /// <returns>存在返回此窗口的实例 不存在返回null</returns> Form CheckIsExit( string ps_windowName) { for(int i=0;i<this.MdiChildren.Length;i++) { if(this.MdiChildren[i].Name==ps_windowName) { return this.MdiChildren[i]; } } return null; }
Opacity = 0.0 ; Activate(); Refresh(); fadeTimer.Start(); Refresh();
if (m_showing) { double d = 1000.0 / fadeTimer.Interval / 100.0; if (Opacity + d >= 1.0) { Opacity = 1.0; fadeTimer.Stop(); } else { Opacity += d; } } else { double d = 1000.0 / fadeTimer.Interval / 100.0; if (Opacity - d <= 0.0) { Opacity = 0.0; fadeTimer.Stop(); } else { Opacity -= d; } }
public class OSTextBox:TextBox { public OSTextBox() { } bool mb_IsKeyEnter=true; [ Category("Data"), DefaultValue(true), MergableProperty(false) ] public bool IsKeyEnter { get { return mb_IsKeyEnter; } set { mb_IsKeyEnter=value; } } protected override void OnKeyPress(KeyPressEventArgs e) { base.OnKeyPress (e); if(mb_IsKeyEnter) { if (e.KeyChar == (char)Keys.Enter) { SendKeys.Send("{Tab}"); } } } }