UI Initial
private void UIInitial()
{
#region Field
cv_MouseDownFlag = false;
cv_MousePos = new Point();
#endregion
#region Tip
cv_Tip = new ToolTip();
#endregion
#region Server Name
cv_lbServerName = new Label();
cv_lbServerName.AutoSize = true;
cv_lbServerName.Location = new System.Drawing.Point(8, 10);
cv_lbServerName.Size = new System.Drawing.Size(33, 12);
cv_lbServerName.Text = "Name : ";
#endregion
#region lbStatus
cv_lbStatus = new Label();
cv_lbStatus.AutoSize = true;
cv_lbStatus.Location = new System.Drawing.Point(8, 30);
cv_lbStatus.Size = new System.Drawing.Size(33, 12);
cv_lbStatus.Text = "Status : ";
#endregion
#region lbCpuRatio
cv_lbCpuRatio = new Label();
cv_lbCpuRatio.AutoSize = true;
cv_lbCpuRatio.Location = new System.Drawing.Point(8, 50);
cv_lbCpuRatio.Size = new System.Drawing.Size(33, 12);
cv_lbCpuRatio.Text = "Cpu : ";
#endregion
#region lbStatus
cv_lbRefreshTime = new Label();
cv_lbRefreshTime.AutoSize = true;
cv_lbRefreshTime.Location = new System.Drawing.Point(8, 70);
cv_lbRefreshTime.Size = new System.Drawing.Size(33, 12);
cv_lbRefreshTime.Text = "Refresh Time : ";
#endregion
#region Panel
cv_Panel = new Panel();
cv_Panel.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
cv_Panel.Controls.Add(cv_lbServerName);
cv_Panel.Controls.Add(cv_lbStatus);
cv_Panel.Controls.Add(cv_lbCpuRatio);
cv_Panel.Controls.Add(cv_lbRefreshTime);
cv_Panel.Location = cv_Location; //new System.Drawing.Point(50, 47);
cv_Panel.Name = "";
cv_Panel.Size = new System.Drawing.Size(200, 90);
cv_Panel.TabIndex = 1;
cv_Panel.MouseEnter += new EventHandler(cv_Panel_MouseEnter);
cv_Panel.MouseLeave += new EventHandler(cv_Panel_MouseLeave);
cv_Panel.MouseDown += new MouseEventHandler(cv_Panel_MouseDown);
cv_Panel.MouseMove += new MouseEventHandler(cv_Panel_MouseMove);
cv_Panel.Click += new EventHandler(cv_Panel_Click);
cv_Parent.Controls.Add(cv_Panel);
#endregion
}
private void UiRelease()
{
#region Delegate
#endregion
#region Field
#endregion
#region Tip
#endregion
#region Panel
if (cv_Panel != null)
{
cv_Parent.Controls.Remove(cv_Panel);
cv_Panel.MouseEnter -= cv_Panel_MouseEnter;
cv_Panel.MouseLeave -= cv_Panel_MouseLeave;
cv_Panel.Dispose();
cv_Panel = null;
}
#endregion
}
留言
張貼留言