初步开发

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. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.components = new System.ComponentModel.Container(); toolStrip1 = new ToolStrip();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; tscbYear = new ToolStripComboBox();
this.ClientSize = new System.Drawing.Size(800,450); tscbMonth = new ToolStripComboBox();
this.Text = "Form1"; 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 #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() { public Form1() {
InitializeComponent(); 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

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </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> </root>