初步开发

This commit is contained in:
FalconFly 2024-06-13 15:54:20 +08:00
parent 1846660da2
commit 82bef73c4c
3 changed files with 140 additions and 30 deletions

View File

@ -25,12 +25,87 @@
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800,450);
this.Text = "Form1";
toolStrip1 = new ToolStrip();
tscbYear = new ToolStripComboBox();
tscbMonth = new ToolStripComboBox();
tabPanel = new TableLayoutPanel();
label1 = new Label();
toolStrip1.SuspendLayout();
tabPanel.SuspendLayout();
SuspendLayout();
//
// toolStrip1
//
toolStrip1.Items.AddRange(new ToolStripItem[] { tscbYear,tscbMonth });
toolStrip1.Location = new Point(0,0);
toolStrip1.Name = "toolStrip1";
toolStrip1.Size = new Size(465,25);
toolStrip1.TabIndex = 0;
toolStrip1.Text = "toolStrip1";
//
// tscbYear
//
tscbYear.DropDownStyle = ComboBoxStyle.DropDownList;
tscbYear.Items.AddRange(new object[] { "2024","2025" });
tscbYear.Name = "tscbYear";
tscbYear.Size = new Size(121,25);
//
// tscbMonth
//
tscbMonth.DropDownStyle = ComboBoxStyle.DropDownList;
tscbMonth.Name = "tscbMonth";
tscbMonth.Size = new Size(121,25);
//
// tabPanel
//
tabPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble;
tabPanel.ColumnCount = 2;
tabPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent,50F));
tabPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent,50F));
tabPanel.Controls.Add(label1,1,0);
tabPanel.Dock = DockStyle.Fill;
tabPanel.Location = new Point(0,25);
tabPanel.Name = "tabPanel";
tabPanel.Padding = new Padding(10);
tabPanel.RowCount = 2;
tabPanel.RowStyles.Add(new RowStyle(SizeType.Percent,50F));
tabPanel.RowStyles.Add(new RowStyle(SizeType.Percent,50F));
tabPanel.Size = new Size(465,225);
tabPanel.TabIndex = 1;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(237,13);
label1.Name = "label1";
label1.Size = new Size(15,17);
label1.TabIndex = 0;
label1.Text = "1";
//
// Form1
//
AutoScaleDimensions = new SizeF(7F,17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(465,250);
Controls.Add(tabPanel);
Controls.Add(toolStrip1);
Name = "Form1";
Text = "Form1";
Load += Form1_Load;
toolStrip1.ResumeLayout(false);
toolStrip1.PerformLayout();
tabPanel.ResumeLayout(false);
tabPanel.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
#endregion
private ToolStrip toolStrip1;
private ToolStripComboBox tscbYear;
private ToolStripComboBox tscbMonth;
private TableLayoutPanel tabPanel;
private Label label1;
}
}

View File

@ -5,5 +5,37 @@ namespace CalendarNotepad
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender,EventArgs e) {
var year1 = 2024;
do {
this.tscbYear.Items.Add(year1);
year1++;
} while(year1 > DateTime.Now.Year + 1);
this.tscbYear.Text = DateTime.Now.Year.ToString();
for(int i = 0;i < 12;i++) {
this.tscbMonth.Items.Add((i + 1) + "ÔÂ");
}
this.tscbMonth.Text = DateTime.Now.Month.ToString() + "ÔÂ";
this.tabPanel.RowStyles.Clear();
this.tabPanel.ColumnStyles.Clear();
this.tabPanel.RowCount = 7;
this.tabPanel.ColumnCount = 7;
for(int i = 0;i < 7;i++) {
this.tabPanel.RowStyles.Add(new RowStyle(SizeType.Percent,100 / 7));
this.tabPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent,100 / 7));
}
this.tabPanel.Controls.Clear();
int d = 1;
for(int x = 0;x < 7;x++) {
for(int y = 0;y < 7;y++) {
var lab = new Label();
lab.Text = d++.ToString();
this.tabPanel.Controls.Add(lab,y,x);
}
}
}
}
}

View File

@ -18,7 +18,7 @@
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>