是的,demo中有新建文档,其实demo有对应的源码项目,位置为
E:\Users\Administrator\Documents\TX Text Control 24.0.NET for Windows Forms\Samples\WinForms\CSharp\TX Text Control Words
可以从 “我的文档”>>TX Text Control 24.0.NET for Windows 开始找
源码中即有每一个菜单项的对应代码
- public void FileNew() {
- if (_fileHandler.DocumentDirty) {
- switch (MessageBox.Show("Save changes to " + _fileHandler.DocumentTitle + "?", "Question", MessageBoxButtons.YesNoCancel)) {
- case System.Windows.Forms.DialogResult.Cancel:
- return;
- case System.Windows.Forms.DialogResult.Yes:
- _fileHandler.FileSave();
- if (_fileHandler.DocumentFileName == "")
- return;
- break;
- case System.Windows.Forms.DialogResult.No:
- break;
- }
- }
- _fileHandler.DocumentFileName = "";
- _textControl.ResetContents();
- this.Text = this.ProductName.ToString() + " - " + _fileHandler.DocumentTitle;
- _fileHandler.DocumentDirty = false;
- }
复制代码
|