Ejemplo n.º 1
0
 private void FindText_Load(object sender, EventArgs e)
 {
     i     = 0;
     tempi = 1;
     this.nextFind.Enabled = false;                     //查找按钮在查找文本框没输内容时应该是不可用的
     cf           = (ChildForm)MainForm.getChildForm(); //要获取到主窗口中创建的子窗体的实例,不然直接new的话不能够准确的获取到子窗体的数据。
     isMatchWords = false;
     isCircle     = false;
     isMatchCaps  = false;
     isReverse    = false;
 }
Ejemplo n.º 2
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     this.Text    = "未命名 - 记事本";    //标题栏,美化作用
     cf           = new ChildForm();
     cf.MdiParent = this;           //设置子窗体
     cf.Dock      = DockStyle.Fill; //使子窗体充满父窗体
     cf.Show();                     //显示子窗体
     openFileName = String.Empty;   //全局变量清空
     FileisOpen   = false;
     this.自动换行WToolStripMenuItem.Checked = true;
     this.状态栏ToolStripMenuItem.Checked   = true;
 }
Ejemplo n.º 3
0
        private void FontSelectForm_Load(object sender, EventArgs e)
        {
            cf = (ChildForm)MainForm.getChildForm();
            int indexSize;

            this.selectFont.Text = cf.Getfont().Name;
            this.sizeText.Text   = cf.Getfont().Size.ToString();
            shape = cf.Getfont().Style;
            if (shape.Equals(FontStyle.Regular))
            {
                this.shapeText.Text     = "常规";
                shapeList.SelectedIndex = 0;
            }
            else if (shape.Equals(FontStyle.Italic))
            {
                this.shapeText.Text     = "倾斜";
                shapeList.SelectedIndex = 1;
            }
            else if (shape.Equals(FontStyle.Bold))
            {
                this.shapeText.Text     = "粗体";
                shapeList.SelectedIndex = 2;
            }
            else if (shape.Equals(FontStyle.Bold | FontStyle.Italic))
            {
                this.shapeText.Text     = "粗体 倾斜";
                shapeList.SelectedIndex = 3;
            }
            foreach (System.Drawing.FontFamily i in objFont.Families)
            {
                this.fontList.Items.Add(i.Name.ToString());
            }

            this.fontList.SelectedIndex = this.fontList.FindString(this.selectFont.Text);
            indexSize = this.fontList.SelectedIndex - 3;
            if (indexSize < 0)
            {
                indexSize = 0;
            }
            this.fontList.TopIndex = indexSize;

            this.previewtext.Font = new System.Drawing.Font(cf.Getfont().Name, float.Parse(cf.Getfont().Size.ToString()), cf.Getfont().Style, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
        }
Ejemplo n.º 4
0
 private void ReplaceTextForm_Load(object sender, EventArgs e)
 {
     cf = (ChildForm)MainForm.getChildForm();
 }