随笔分类 -  C# richTextBox

摘要:只能粘贴剪切板中的TXT内容 并且 不能改变 剪切板的内容1 当用户按下Ctrl+V屏蔽系统的粘贴功能,然后添加自己的功能2019年12月19日 19:34:38 阅读全文
posted @ 2019-12-23 21:14 XE2011 阅读(960) 评论(0) 推荐(0) 编辑
摘要:附件:http://files.cnblogs.com/xe2011/WindowsFormsApplication_LimitRichTextBoxInput.rarusingSystem;usingSystem.Collections.Generic;usingSystem.ComponentM... 阅读全文
posted @ 2014-06-10 21:42 XE2011 阅读(818) 评论(0) 推荐(0) 编辑
摘要:if (richTextBox1.SelectedRtf.IndexOf(@"{\pict") > -1) { Text = "Img"; } else { Text = "Form1"; } 阅读全文
posted @ 2013-12-17 17:11 XE2011 阅读(398) 评论(0) 推荐(0) 编辑
摘要:附件:http://files.cnblogs.com/xe2011/CSHARP_RichTextBoxEditor.rar完整的转到这里 http://www.cnblogs.com/xe2011/p/3449333.html主要的类 1 using System; 2 //using System.Collections.Generic; 3 //using System.Linq; 4 using System.Text; 5 using System.Drawing; 6 //using System.Windows.Forms; 7 using System.Runt... 阅读全文
posted @ 2013-12-13 15:03 XE2011 阅读(1463) 评论(0) 推荐(0) 编辑
摘要:附件 http://files.cnblogs.com/xe2011/richTextBox_EM_SETRECT.rarusing System.Runtime.InteropServices; public struct Rect { public int Left; public int Top; public int Right; public int Bottom; } [DllImport("user32.dll")] private s... 阅读全文
posted @ 2013-12-11 16:28 XE2011 阅读(1360) 评论(1) 推荐(0) 编辑
摘要:获得光标所在的行号获得光标所在的列号设置光标到指定行号设置光标到指定列号http://www.huifangseo.com/blog/6/7.html 获得光标所在的行号和列号方法1 int SelStart = richTextBox1.SelectionStart; int Line = 1 + richTextBox1.GetLineFromCharIndex(SelStart); //行值 int Column = 1 + SelStart - (richTextBox1.GetFirstCharIndexFromLine(Line - 1));//列值 Tex... 阅读全文
posted @ 2013-12-09 13:24 XE2011 阅读(475) 评论(0) 推荐(0) 编辑
摘要:附件:http://files.cnblogs.com/xe2011/CSharp_DragQueryFile.rarusing System.Runtime.InteropServices; this.AllowDrop = true; [DllImport("shell32.dll")] public static extern uint DragQueryFile(int hDrop, uint iFile, StringBuilder lpszFile, uint cch); [DllImport("shell32.dll")] ... 阅读全文
posted @ 2013-12-03 20:33 XE2011 阅读(759) 评论(0) 推荐(0) 编辑
摘要:附件 http://files.cnblogs.com/xe2011/richTextBox_InsertTable_Full.rar调用 richTextBoxTableDlg dlg = new richTextBoxTableDlg(); dlg.richTextBox = richTextBox51; if (dlg.ShowDialog() ==DialogResult.OK) { richTextBoxTable r1 = new richTextBoxTable(); ... 阅读全文
posted @ 2013-12-03 17:08 XE2011 阅读(1505) 评论(0) 推荐(0) 编辑
摘要:附件:http://files.cnblogs.com/xe2011/richTextBox_InsertTable.rar插入表格 /// /// 插入表格 /// /// /// 行 /// 列 /// =TRUE:自动设置每个单元格的大小 private void InsertTable(RichTextBox richTextBox,int col, int row,bool AutoSize) { StringBuilder rtf ... 阅读全文
posted @ 2013-12-03 14:17 XE2011 阅读(1555) 评论(0) 推荐(0) 编辑
摘要:使用private void button1_Click(object sender, EventArgs e){ RichTextBoxCtrl.richTextBoxFontClass r = new RichTextBoxCtrl.richTextBoxFontClass(); r.richTextBox = richTextBox1; r.ToggleBold();}using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows... 阅读全文
posted @ 2013-11-27 16:54 XE2011 阅读(293) 评论(0) 推荐(0) 编辑
摘要:执行一次设置选中的字体样式 再执行一次恢复正常 //粗体 public void ToggleBold(){ if (richTextBox1.SelectionFont == null) richTextBox1.SelectionFont = richTextBox1.Font; FontStyle style = richTextBox1... 阅读全文
posted @ 2013-11-27 16:37 XE2011 阅读(789) 评论(0) 推荐(0) 编辑
摘要:设置和获取选中的样式为 1. 2. 3. #region 数字序列 1. 2. 3. 4. 5. ... private bool bOrder = false; public bool SelectionOrderList { get { return ( (GetSelectionParaformat2wNumbering() == Paraformat2Numbering.ArabicNumbers) && ... 阅读全文
posted @ 2013-11-27 11:44 XE2011 阅读(350) 评论(0) 推荐(0) 编辑
摘要:附件http://files.cnblogs.com/xe2011/CSharpWinForm_richTextBoxPrintClass.rar在窗体上一个Richtextbox 控件 和3个按钮调用页面设置 private void btnPageSetup_Click(object sender, EventArgs e) { richTextBoxPrintClass r = new richTextBoxPrintClass(); r.richTextBox = richTextBox1; r.Show... 阅读全文
posted @ 2013-11-26 21:40 XE2011 阅读(877) 评论(0) 推荐(0) 编辑
摘要:附件http://files.cnblogs.com/xe2011/CSHARP_RichtextBox_PRINT.rar打印详情http://support.microsoft.com/kb/812425/zh-cn 阅读全文
posted @ 2013-11-26 21:02 XE2011 阅读(324) 评论(0) 推荐(0) 编辑
摘要:private void Form1_Load(object sender, EventArgs e) { richTextBox1.AllowDrop = true; richTextBox1.EnableAutoDragDrop = true; } 阅读全文
posted @ 2013-11-26 20:40 XE2011 阅读(354) 评论(0) 推荐(0) 编辑
摘要:http://files.cnblogs.com/xe2011/CustomRichTextBox_HideCaret.rarrichTextBox能高亮选择,光标仍在,没有光标闪烁把重RichTextBox类去除闪烁光标 http://msdn.microsoft.com/en-us/library/windows/desktop/ms648403%28v=vs.85%29.aspxusing System;using System.Windows.Forms;using System.Runtime.InteropServices;namespace WindowsFormsApplica 阅读全文
posted @ 2013-11-26 11:20 XE2011 阅读(3094) 评论(0) 推荐(0) 编辑
摘要:这个和WINDOWS创建RTF文件一样public void CreateRtfFile(string RtfFileName) { RichTextBox richTextBox1 = new RichTextBox(); richTextBox1.SaveFile(RtfFileName); }private void button1_Click(object sender, EventArgs e) { string Dir = @"C:\Users\Admin\Desktop\"; st... 阅读全文
posted @ 2013-11-23 17:25 XE2011 阅读(1525) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示