Exemplo n.º 1
0
 /// <summary>
 /// 控件添加方法
 /// </summary>
 public override void OnAdd()
 {
     base.OnAdd();
     if (m_closeButton == null)
     {
         m_closeButton      = new WindowButton();
         m_closeButton.Name = "btnClose";
         SIZE buttonSize = new SIZE(20, 20);
         m_closeButton.Size = buttonSize;
         AddControl(m_closeButton);
     }
     if (m_maxOrRestoreButton == null)
     {
         m_maxOrRestoreButton       = new WindowButton();
         m_maxOrRestoreButton.Name  = "btnMaxOrRestore";
         m_maxOrRestoreButton.Style = WindowButtonStyle.Max;
         SIZE buttonSize = new SIZE(20, 20);
         m_maxOrRestoreButton.Size = buttonSize;
         AddControl(m_maxOrRestoreButton);
         m_maxOrRestoreButton.RegisterEvent(new ControlMouseEvent(ClickButton), EVENTID.CLICK);
     }
     if (m_minButton == null)
     {
         m_minButton       = new WindowButton();
         m_minButton.Name  = "btnMin";
         m_minButton.Style = WindowButtonStyle.Min;
         SIZE buttonSize = new SIZE(20, 20);
         m_minButton.Size = buttonSize;
         AddControl(m_minButton);
         m_minButton.RegisterEvent(new ControlMouseEvent(ClickButton), EVENTID.CLICK);
     }
     Font = new FONT("微软雅黑", 14, true, false, false);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 控件添加方法
 /// </summary>
 public override void OnAdd()
 {
     base.OnAdd();
     if (m_closeButton == null)
     {
         m_closeButton      = new WindowButton();
         m_closeButton.Name = "btnClose";
         SIZE buttonSize = new SIZE(20, 20);
         m_closeButton.Size = buttonSize;
         AddControl(m_closeButton);
     }
     if (m_maxOrRestoreButton == null)
     {
         m_maxOrRestoreButton       = new WindowButton();
         m_maxOrRestoreButton.Name  = "btnMaxOrRestore";
         m_maxOrRestoreButton.Style = WindowButtonStyle.Max;
         SIZE buttonSize = new SIZE(20, 20);
         m_maxOrRestoreButton.Size = buttonSize;
         AddControl(m_maxOrRestoreButton);
         m_maxOrRestoreButton.Visible = m_showMaxBox;
         m_maxOrRestoreButton.RegisterEvent(new ControlMouseEvent(ClickButton), EVENTID.CLICK);
     }
     if (m_minButton == null)
     {
         m_minButton       = new WindowButton();
         m_minButton.Name  = "btnMin";
         m_minButton.Style = WindowButtonStyle.Min;
         SIZE buttonSize = new SIZE(20, 20);
         m_minButton.Size = buttonSize;
         AddControl(m_minButton);
         m_minButton.Visible = m_showMinBox;
         m_minButton.RegisterEvent(new ControlMouseEvent(ClickButton), EVENTID.CLICK);
     }
 }