📄 filetextbox.cs
字号:
#region Using directives
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
#endregion
namespace UserControlLibrarySample {
public class FileTextBox : TextBox {
protected override void OnTextChanged(EventArgs e) {
// If the file does not exist, color the text red
if( !File.Exists(this.Text) ) {
this.ForeColor = Color.Red;
}
else { // Make it black
this.ForeColor = Color.Black;
}
// Call the base class
base.OnTextChanged(e);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -