![](/img/trans.png)
[英]How to save an HTML file with fastcoloredtextbox.dll component?
[英]How do you open a file and view it in a FastColoredTextBox component in c#
您只需要像默認的winforms文本框一樣加載文件。 fastColoredTextBox1只是擴展的文本框。 我嘗試過,它就像魅力。
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
{
var loadedText = File.ReadAllText(ofd.FileName);
fastColoredTextBox1.Text = loadedText;
}
內置方法是OpenFile
,它可以按預期初始化控件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.