diff --git a/CalendarNotepad/Form1.Designer.cs b/CalendarNotepad/Form1.Designer.cs index 3da3c0a..cb57f20 100644 --- a/CalendarNotepad/Form1.Designer.cs +++ b/CalendarNotepad/Form1.Designer.cs @@ -25,12 +25,87 @@ /// the contents of this method with the code editor. /// 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; } } \ No newline at end of file diff --git a/CalendarNotepad/Form1.cs b/CalendarNotepad/Form1.cs index f36903e..f1c52c7 100644 --- a/CalendarNotepad/Form1.cs +++ b/CalendarNotepad/Form1.cs @@ -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); + } + } + } } } \ No newline at end of file diff --git a/CalendarNotepad/Form1.resx b/CalendarNotepad/Form1.resx index 1af7de1..40524cc 100644 --- a/CalendarNotepad/Form1.resx +++ b/CalendarNotepad/Form1.resx @@ -1,24 +1,24 @@  - @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file