?? form1.cs
字號:
// menuItemAll
//
this.menuItemAll.Enabled = ((bool)(resources.GetObject("menuItemAll.Enabled")));
this.menuItemAll.Index = 7;
this.menuItemAll.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemAll.Shortcut")));
this.menuItemAll.ShowShortcut = ((bool)(resources.GetObject("menuItemAll.ShowShortcut")));
this.menuItemAll.Text = resources.GetString("menuItemAll.Text");
this.menuItemAll.Visible = ((bool)(resources.GetObject("menuItemAll.Visible")));
this.menuItemAll.Click += new System.EventHandler(this.menuItemAll_Click);
//
// menuItemTime
//
this.menuItemTime.Enabled = ((bool)(resources.GetObject("menuItemTime.Enabled")));
this.menuItemTime.Index = 8;
this.menuItemTime.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemTime.Shortcut")));
this.menuItemTime.ShowShortcut = ((bool)(resources.GetObject("menuItemTime.ShowShortcut")));
this.menuItemTime.Text = resources.GetString("menuItemTime.Text");
this.menuItemTime.Visible = ((bool)(resources.GetObject("menuItemTime.Visible")));
this.menuItemTime.Click += new System.EventHandler(this.menuItemTime_Click);
//
// menuItem2
//
this.menuItem2.Enabled = ((bool)(resources.GetObject("menuItem2.Enabled")));
this.menuItem2.Index = 2;
this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItemChunTian,
this.menuItemJingDian,
this.menuItemHejin,
this.menuItem9,
this.menuItemCancelSkin,
this.menuItemLoadSkin});
this.menuItem2.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItem2.Shortcut")));
this.menuItem2.ShowShortcut = ((bool)(resources.GetObject("menuItem2.ShowShortcut")));
this.menuItem2.Text = resources.GetString("menuItem2.Text");
this.menuItem2.Visible = ((bool)(resources.GetObject("menuItem2.Visible")));
//
// menuItemJingDian
//
this.menuItemJingDian.Enabled = ((bool)(resources.GetObject("menuItemJingDian.Enabled")));
this.menuItemJingDian.Index = 1;
this.menuItemJingDian.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemJingDian.Shortcut")));
this.menuItemJingDian.ShowShortcut = ((bool)(resources.GetObject("menuItemJingDian.ShowShortcut")));
this.menuItemJingDian.Text = resources.GetString("menuItemJingDian.Text");
this.menuItemJingDian.Visible = ((bool)(resources.GetObject("menuItemJingDian.Visible")));
this.menuItemJingDian.Click += new System.EventHandler(this.menuItemJingDian_Click);
//
// menuItemChunTian
//
this.menuItemChunTian.Checked = true;
this.menuItemChunTian.Enabled = ((bool)(resources.GetObject("menuItemChunTian.Enabled")));
this.menuItemChunTian.Index = 0;
this.menuItemChunTian.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemChunTian.Shortcut")));
this.menuItemChunTian.ShowShortcut = ((bool)(resources.GetObject("menuItemChunTian.ShowShortcut")));
this.menuItemChunTian.Text = resources.GetString("menuItemChunTian.Text");
this.menuItemChunTian.Visible = ((bool)(resources.GetObject("menuItemChunTian.Visible")));
this.menuItemChunTian.Click += new System.EventHandler(this.menuItemChunTian_Click);
//
// menuItemHejin
//
this.menuItemHejin.Enabled = ((bool)(resources.GetObject("menuItemHejin.Enabled")));
this.menuItemHejin.Index = 2;
this.menuItemHejin.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemHejin.Shortcut")));
this.menuItemHejin.ShowShortcut = ((bool)(resources.GetObject("menuItemHejin.ShowShortcut")));
this.menuItemHejin.Text = resources.GetString("menuItemHejin.Text");
this.menuItemHejin.Visible = ((bool)(resources.GetObject("menuItemHejin.Visible")));
this.menuItemHejin.Click += new System.EventHandler(this.menuItemHejin_Click);
//
// menuItem9
//
this.menuItem9.Enabled = ((bool)(resources.GetObject("menuItem9.Enabled")));
this.menuItem9.Index = 3;
this.menuItem9.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItem9.Shortcut")));
this.menuItem9.ShowShortcut = ((bool)(resources.GetObject("menuItem9.ShowShortcut")));
this.menuItem9.Text = resources.GetString("menuItem9.Text");
this.menuItem9.Visible = ((bool)(resources.GetObject("menuItem9.Visible")));
//
// menuItemCancelSkin
//
this.menuItemCancelSkin.Enabled = ((bool)(resources.GetObject("menuItemCancelSkin.Enabled")));
this.menuItemCancelSkin.Index = 4;
this.menuItemCancelSkin.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemCancelSkin.Shortcut")));
this.menuItemCancelSkin.ShowShortcut = ((bool)(resources.GetObject("menuItemCancelSkin.ShowShortcut")));
this.menuItemCancelSkin.Text = resources.GetString("menuItemCancelSkin.Text");
this.menuItemCancelSkin.Visible = ((bool)(resources.GetObject("menuItemCancelSkin.Visible")));
this.menuItemCancelSkin.Click += new System.EventHandler(this.menuItemCancelSkin_Click);
//
// menuItemLoadSkin
//
this.menuItemLoadSkin.Enabled = ((bool)(resources.GetObject("menuItemLoadSkin.Enabled")));
this.menuItemLoadSkin.Index = 5;
this.menuItemLoadSkin.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemLoadSkin.Shortcut")));
this.menuItemLoadSkin.ShowShortcut = ((bool)(resources.GetObject("menuItemLoadSkin.ShowShortcut")));
this.menuItemLoadSkin.Text = resources.GetString("menuItemLoadSkin.Text");
this.menuItemLoadSkin.Visible = ((bool)(resources.GetObject("menuItemLoadSkin.Visible")));
this.menuItemLoadSkin.Click += new System.EventHandler(this.menuItemLoadSkin_Click);
//
// menuItemFormat
//
this.menuItemFormat.Enabled = ((bool)(resources.GetObject("menuItemFormat.Enabled")));
this.menuItemFormat.Index = 3;
this.menuItemFormat.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItemReturn,
this.menuItem24,
this.menuItemFont,
this.menuItemBackcolor});
this.menuItemFormat.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemFormat.Shortcut")));
this.menuItemFormat.ShowShortcut = ((bool)(resources.GetObject("menuItemFormat.ShowShortcut")));
this.menuItemFormat.Text = resources.GetString("menuItemFormat.Text");
this.menuItemFormat.Visible = ((bool)(resources.GetObject("menuItemFormat.Visible")));
//
// menuItemReturn
//
this.menuItemReturn.Enabled = ((bool)(resources.GetObject("menuItemReturn.Enabled")));
this.menuItemReturn.Index = 0;
this.menuItemReturn.RadioCheck = true;
this.menuItemReturn.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemReturn.Shortcut")));
this.menuItemReturn.ShowShortcut = ((bool)(resources.GetObject("menuItemReturn.ShowShortcut")));
this.menuItemReturn.Text = resources.GetString("menuItemReturn.Text");
this.menuItemReturn.Visible = ((bool)(resources.GetObject("menuItemReturn.Visible")));
this.menuItemReturn.Click += new System.EventHandler(this.menuItemReturn_Click);
//
// menuItem24
//
this.menuItem24.Enabled = ((bool)(resources.GetObject("menuItem24.Enabled")));
this.menuItem24.Index = 1;
this.menuItem24.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItem24.Shortcut")));
this.menuItem24.ShowShortcut = ((bool)(resources.GetObject("menuItem24.ShowShortcut")));
this.menuItem24.Text = resources.GetString("menuItem24.Text");
this.menuItem24.Visible = ((bool)(resources.GetObject("menuItem24.Visible")));
//
// menuItemFont
//
this.menuItemFont.Enabled = ((bool)(resources.GetObject("menuItemFont.Enabled")));
this.menuItemFont.Index = 2;
this.menuItemFont.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemFont.Shortcut")));
this.menuItemFont.ShowShortcut = ((bool)(resources.GetObject("menuItemFont.ShowShortcut")));
this.menuItemFont.Text = resources.GetString("menuItemFont.Text");
this.menuItemFont.Visible = ((bool)(resources.GetObject("menuItemFont.Visible")));
this.menuItemFont.Click += new System.EventHandler(this.menuItemFont_Click);
//
// menuItemBackcolor
//
this.menuItemBackcolor.Enabled = ((bool)(resources.GetObject("menuItemBackcolor.Enabled")));
this.menuItemBackcolor.Index = 3;
this.menuItemBackcolor.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemBackcolor.Shortcut")));
this.menuItemBackcolor.ShowShortcut = ((bool)(resources.GetObject("menuItemBackcolor.ShowShortcut")));
this.menuItemBackcolor.Text = resources.GetString("menuItemBackcolor.Text");
this.menuItemBackcolor.Visible = ((bool)(resources.GetObject("menuItemBackcolor.Visible")));
this.menuItemBackcolor.Click += new System.EventHandler(this.menuItemBackcolor_Click);
//
// menuItemHelp
//
this.menuItemHelp.Enabled = ((bool)(resources.GetObject("menuItemHelp.Enabled")));
this.menuItemHelp.Index = 4;
this.menuItemHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItemAbout});
this.menuItemHelp.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemHelp.Shortcut")));
this.menuItemHelp.ShowShortcut = ((bool)(resources.GetObject("menuItemHelp.ShowShortcut")));
this.menuItemHelp.Text = resources.GetString("menuItemHelp.Text");
this.menuItemHelp.Visible = ((bool)(resources.GetObject("menuItemHelp.Visible")));
//
// menuItemAbout
//
this.menuItemAbout.Enabled = ((bool)(resources.GetObject("menuItemAbout.Enabled")));
this.menuItemAbout.Index = 0;
this.menuItemAbout.MdiList = true;
this.menuItemAbout.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("menuItemAbout.Shortcut")));
this.menuItemAbout.ShowShortcut = ((bool)(resources.GetObject("menuItemAbout.ShowShortcut")));
this.menuItemAbout.Text = resources.GetString("menuItemAbout.Text");
this.menuItemAbout.Visible = ((bool)(resources.GetObject("menuItemAbout.Visible")));
this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click);
//
// saveFileDialog1
//
this.saveFileDialog1.Filter = resources.GetString("saveFileDialog1.Filter");
this.saveFileDialog1.InitialDirectory = "%USERPROFILE%";
this.saveFileDialog1.RestoreDirectory = true;
this.saveFileDialog1.Title = resources.GetString("saveFileDialog1.Title");
//
// fontDialog1
//
this.fontDialog1.FontMustExist = true;
this.fontDialog1.ShowColor = true;
//
// colorDialog1
//
this.colorDialog1.AnyColor = true;
//
// textBox
//
this.textBox.AcceptsReturn = true;
this.textBox.AccessibleDescription = resources.GetString("textBox.AccessibleDescription");
this.textBox.AccessibleName = resources.GetString("textBox.AccessibleName");
this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("textBox.Anchor")));
this.textBox.AutoSize = ((bool)(resources.GetObject("textBox.AutoSize")));
this.textBox.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("textBox.BackgroundImage")));
this.textBox.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("textBox.Dock")));
this.textBox.Enabled = ((bool)(resources.GetObject("textBox.Enabled")));
this.textBox.Font = ((System.Drawing.Font)(resources.GetObject("textBox.Font")));
this.textBox.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("textBox.ImeMode")));
this.textBox.Location = ((System.Drawing.Point)(resources.GetObject("textBox.Location")));
this.textBox.MaxLength = ((int)(resources.GetObject("textBox.MaxLength")));
this.textBox.Multiline = ((bool)(resources.GetObject("textBox.Multiline")));
this.textBox.Name = "textBox";
this.textBox.PasswordChar = ((char)(resources.GetObject("textBox.PasswordChar")));
this.textBox.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("textBox.RightToLeft")));
this.textBox.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("textBox.ScrollBars")));
this.textBox.Size = ((System.Drawing.Size)(resources.GetObject("textBox.Size")));
this.textBox.TabIndex = ((int)(resources.GetObject("textBox.TabIndex")));
this.textBox.Text = resources.GetString("textBox.Text");
this.textBox.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("textBox.TextAlign")));
this.textBox.Visible = ((bool)(resources.GetObject("textBox.Visible")));
this.textBox.WordWrap = ((bool)(resources.GetObject("textBox.WordWrap")));
this.textBox.TextChanged += new System.EventHandler(this.textBox_TextChanged);
//
// openFileDialog1
//
this.openFileDialog1.Filter = resources.GetString("openFileDialog1.Filter");
this.openFileDialog1.RestoreDirectory = true;
this.openFileDialog1.Title = resources.GetString("openFileDialog1.Title");
//
// NotePad
//
this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
this.AccessibleName = resources.GetString("$this.AccessibleName");
this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
this.Controls.Add(this.textBox);
this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
this.Menu = this.mainMenu;
this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
this.Name = "NotePad";
this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
this.Text = resources.GetString("$this.Text");
this.Closing += new System.ComponentModel.CancelEventHandler(this.NotePad_Closing);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 應用程序的主入口點。
/// </summary>
[STAThread]
static void Main()
{
if (SkinStart(".\\skin\\spring.urf",4,"",1,0,0)==0)
{
MessageBox.Show("找不到皮膚 -- \"春天\" ");
SkinStart(".\\skin\\belv.urf",4,"",1,0,0);
}
Application.Run(new NotePad());
SkinRemove();
}
//新建
private void menuItemNew_Click(object sender, System.EventArgs e)
{
if (needtosave==true)
{
DialogResult result = MessageBox.Show(CurrentFileName+" 的內容已經改變,需要保存嗎?","保存文件",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Question);
switch(result)
{
case DialogResult.OK:
{
menuItemSave_Click(sender,e);
textBox.Clear();
needtosave=false;
break;
}
case DialogResult.No:
{
textBox.Clear();
this.Text = "文本編輯--新建文本";
needtosave=false;
break;
}
case DialogResult.Cancel:
{
break;
}
}
}
else
{
textBox.Clear();
this.Text = "文本編輯--新建文本";
needtosave=false;
}
}
private void menuItemExit_Click(object sender, System.EventArgs e)
{
Close();
}
private void menuItemHelp_Click(object sender, System.EventArgs e)
{
}
private void menuItemOpen_Click(object sender, System.EventArgs e)
{
try
{
if (needtosave==true)
{
DialogResult result = MessageBox.Show(CurrentFileName+" 的內容已經改變,需要保存嗎?","保存文件",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Question);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -