📄 paragraphform.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace CSharpNotepad
{
public partial class paragraphForm : Form
{
private mainForm _Owner; //标记该子窗口的父窗口
public paragraphForm()
{
InitializeComponent();
}
public paragraphForm(mainForm _Parent)
{
InitializeComponent();
_Owner = _Parent; //设置该子窗口的父窗口
}
private void okButton_Click(object sender, EventArgs e)
{
try
{
int i;
i = int.Parse(tbLeft.Text);
this._Owner.currentForm.richTextBox1.SelectionHangingIndent = i;
i = int.Parse(tbRight.Text);
this._Owner.currentForm.richTextBox1.SelectionRightIndent = i;
i = int.Parse(tbFirstLine.Text);
this._Owner.currentForm.richTextBox1.SelectionIndent = i;
this.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void cancelButton_Click(object sender, EventArgs e)
{
this.Close();
}
private void paragraphForm_Load(object sender, EventArgs e)
{
tbLeft.Text = this._Owner.currentForm.richTextBox1.SelectionHangingIndent.ToString();
tbRight.Text = this._Owner.currentForm.richTextBox1.SelectionRightIndent.ToString();
tbFirstLine.Text = this._Owner.currentForm.richTextBox1.SelectionIndent.ToString();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -