110,532
社区成员
发帖
与我相关
我的任务
分享
public string SetTitle {
get { return Title; }
set {
Title = value;
if (TitleLabel.InvokeRequired) {
var TitleUpdate = new UpdateLabel(UpdateTitle);
Invoke(TitleUpdate);
}
else {
UpdateTitle();
}
}
}
public string SetInfo {
get { return Information; }
set {
Information = value;
if (InfoLabel.InvokeRequired) {
var InfoUpdate = new UpdateLabel(UpdateInfo);
Invoke(InfoUpdate);
}
else {
UpdateInfo();
}
}
}
public string SetStatus {
get { return Status; }
set {
Status = value;
if (StatusLabel.InvokeRequired) {
var StatusUpdate = new UpdateLabel(UpdateStatus);
Invoke(StatusUpdate);
}
else {
UpdateStatus();
}
}
}
//修改LabelTitle的属性
public void SetTitleFont(Color color, int size)
{
SetTitleFont(color, size, this.Font);
}
public void SetTitleFont(Color color, int size, Font font)
{
if (color != color.Empty) {
this.TitleLabel.ForeColor = color;
}
this.TitleLabel.Font = new Font(font.Name, size);
}
public void SetTitleLabel(int LabelWidth, int LabelHeight)
{
SetTitleLabel(Point.Empty, LabelWidth, LabelHeight);
}
public void SetTitleLabel(Point Location, int LabelWidth, int LabelHeight)
{
if (Location != Point.Empty) {
this.TitleLabel.Location = Location;
}
if (LabelWidth == 0 && LabelHeight == 0) {
this.TitleLabel.AutoSize = true;
}
else {
if (LabelWidth > 0) {
this.TitleLabel.Width = LabelWidth;
}
if (LabelHeight > 0) {
this.TitleLabel.Height = LabelHeight;
}
}
}
//修改LabelStatus的属性
public void SetStatusFont(Color color, int size)
{
SetStatusFont(color, size, this.Font);
}
public void SetStatusFont(Color color, int size, Font font)
{
if (color != color.Empty) {
this.StatusLabel.ForeColor = color;
}
this.StatusLabel.Font = new Font(font.Name, size);
}
public void SetStatusLabel(int LabelWidth, int LabelHeight)
{
SetStatusLabel(Point.Empty, LabelWidth, LabelHeight);
}
public void SetStatusLabel(Point Location, int LabelWidth, int LabelHeight)
{
if (Location != Point.Empty) {
StatusLabel.Location = Location;
}
if (LabelWidth == 0 && LabelHeight == 0) {
StatusLabel.AutoSize = true;
}
else {
if (LabelWidth > 0) {
StatusLabel.Width = LabelWidth;
}
if (LabelHeight > 0) {
StatusLabel.Height = LabelHeight;
}
}
}
//修改LabelInfo的属性
public void SetInfoFont(Color color, int size)
{
SetInfoFont(color, size, this.Font);
}
public void SetInfoFont(Color color, int size, Font font)
{
if (color != color.Empty) {
this.InfoLabel.ForeColor = color;
}
this.InfoLabel.Font = new Font(font.Name, size);
}
public void SetInfoLabel(int LabelWidth, int LabelHeight)
{
SetInfoLabel(Point.Empty, LabelWidth, LabelHeight);
}
public void SetInfoLabel(Point Location, int LabelWidth, int LabelHeight)
{
if (Location != Point.Empty) {
InfoLabel.Location = Location;
}
if (LabelWidth == 0 && LabelHeight == 0) {
InfoLabel.AutoSize = true;
}
else {
if (LabelWidth > 0) {
InfoLabel.Width = LabelWidth;
}
if (LabelHeight > 0) {
InfoLabel.Height = LabelHeight;
}
}
}