📄 handseditorform.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace AlarmClockControlLibrary {
partial class HandsEditorForm : Form {
public HandsEditorForm() {
InitializeComponent();
}
private Hand hourHand;
private Hand minuteHand;
private Hand secondHand;
public Hand HourHand {
get { return new Hand(this.hhColorPanel.BackColor, (int)this.hhNumericUpDown.Value); }
set {
this.hourHand = value;
this.hhColorPanel.BackColor = this.hourHand.Color;
this.hhNumericUpDown.Value = this.hourHand.Width;
}
}
public Hand MinuteHand {
get { return new Hand(this.mhColorPanel.BackColor, (int)this.mhNumericUpDown.Value); }
set {
this.minuteHand = value;
this.mhColorPanel.BackColor = this.minuteHand.Color;
this.mhNumericUpDown.Value = this.minuteHand.Width;
}
}
public Hand SecondHand {
get { return new Hand(this.shColorPanel.BackColor, (int)this.shNumericUpDown.Value); }
set {
this.secondHand = value;
this.shColorPanel.BackColor = this.secondHand.Color;
this.shNumericUpDown.Value = this.secondHand.Width;
}
}
private void hhColorButton_Click(object sender, EventArgs e) {
this.colorDialog.Color = this.hhColorPanel.BackColor;
this.colorDialog.ShowDialog();
this.hhColorPanel.BackColor = this.colorDialog.Color;
}
private void mhColorButton_Click(object sender, EventArgs e) {
this.colorDialog.Color = this.mhColorPanel.BackColor;
this.colorDialog.ShowDialog();
this.mhColorPanel.BackColor = this.colorDialog.Color;
}
private void shColorButton_Click(object sender, EventArgs e) {
this.colorDialog.Color = this.shColorPanel.BackColor;
this.colorDialog.ShowDialog();
this.shColorPanel.BackColor = this.colorDialog.Color;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -