richtextbox

Submitting a form with a Dojo Rich Text Editor

人盡茶涼 提交于 2019-12-10 10:19:07
问题 Does anyone out there know how to submit a form that contains a Dojo Rich Text Editor? I've tried adding the "name" attribute to my element that is decorated with dojoType="dijit.Editor", however, I don't see any of the HTML on my receiving process. I've checked the documentation and I don't see any clear example (other than connecting the on submit event of the form in question with another function that sets the data of a hidden input with the "value" of the Rich Text Editor"). I would

TinyMCE: Using CSS class attributes with the formatselect-dropdown formats

拟墨画扇 提交于 2019-12-10 10:08:07
问题 I would like to customize the formats in the TinyMCE formatselect dropdown to support css class attributes. Example: If would like to be able to select <h2 class='foo'> instead of just <h2> as format in the formatselect dropdown. Does anyone here have an idea how I could do this? 回答1: There is no smart way to do this in the current TinyMCE version according to its main developer: We have plans for a advanced style format plugin. So that you can specify formats, styles, containers, wrappers

Set Caret/Cursor Position in RichTextBox - WPF

十年热恋 提交于 2019-12-10 04:33:54
问题 How to set caret/cursor position in RichTextBox in WPF? I use the code in MSDN CaretPosition but it seems the cursor can't be set? // Create a new FlowDocument, and add 3 paragraphs. FlowDocument flowDoc = new FlowDocument(); flowDoc.Blocks.Add(new Paragraph(new Run("Paragraph 1"))); flowDoc.Blocks.Add(new Paragraph(new Run("Paragraph 2"))); flowDoc.Blocks.Add(new Paragraph(new Run("Paragraph 3"))); // Set the FlowDocument to be the content for a new RichTextBox. RichTextBox rtb = new

How to keep track of TextPointer in WPF RichTextBox?

别说谁变了你拦得住时间么 提交于 2019-12-10 03:17:12
问题 I'm trying to get my head around the TextPointer class in a WPF RichTextBox. I would like to be able to keep track of them so that I can associate information with areas in the text. I am currently working with a very simple example to try and figure out what is going on. In the PreviewKeyDown event I am storing the caret position and then in the PreviewKeyUp event I am creating a TextRange based on the before and after caret positions. Here is a code sample that illustrates what I am trying

Creating Rich Text editor AngularJS

狂风中的少年 提交于 2019-12-09 16:08:34
问题 I know there are lots of great rich text editors out there that can easily be ported to angular and plenty of discussion on how to do this, but I'd like to create my own. I have the basic idea down: create a text area and watch the input and perform a function as the input changes. I am familiar with the ngBindhtml directive, only to the extent that I can apply it to an element. Any idea how I might be able to create a function that would render plain text into html ? 回答1: I've tried it

How to make <UIElement> interactable or click-able in WPF UI

孤者浪人 提交于 2019-12-09 13:03:27
问题 This is my first day to design UI using WPF. I have looked up MSDN official document of Flow Document and found that I can place an UI control inside a RichTextBox . I did put a button in but found it's not interactable - I cannot click on it as it's grey. And I also tried other controls and they all displayed fine but just don't support interaction. Even a hyperlink doesn't work. I have searched over internet, the closest question ever asked is about how to make an inside hyperlink click

Is it possible to style text in a richtextbox at design time?

南楼画角 提交于 2019-12-09 12:29:51
问题 I have a System.Windows.Forms.RichTextBox that I wish to use to display some instructions to my application users. Is it possible to set some of the text I enter at designtime to be bold? Or do I have no option but to do it at runtime? 回答1: You can certainly create an RTF document in RTF editor (e.g. WordPad), save the file, open it as a text/plain file and copy the RTF document into the RtfText property of your RichTextBox at design time. But I advise against it. That way, you have a large

Winforms RichTextBox: How can I determine how many lines of text are visible?

江枫思渺然 提交于 2019-12-09 02:51:29
问题 I have a Winforms app containing a RichTextBox. How can I determine how many lines of text are displayed, currently visible? Reason: I want to scroll the caret to the middle of the RichTextBox. I can use RichTextBox.ScrollToCaret(), but that puts the caret at the top of the RichTextBox. I figure, If I know how many lines are displayed, I could move the caret "back" n/2 lines, then call ScrollToCaret(), then restore the original caret position. EDIT: I found EM_GETLINECOUNT, which I thought

save richtextbox to file C#

感情迁移 提交于 2019-12-09 01:26:25
问题 I am having trouble saving from richtextbox to .txt file here is the code: if (richTextBox1.Text != String.Empty) { string dir = @"c:\\logs\\" + DateTime.Today.ToString("dd_MMM_yy"); string path = @"c:\\logs\\" + DateTime.Today.ToString("dd_MMM_yy") + "\\" + DateTime.Now.ToString("HH.mm.ss") + ".txt"; if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } if (!File.Exists(path)) { File.Create(path); richTextBox1.SaveFile(path, RichTextBoxStreamType.RichText); } } else MessageBox.Show

RichTextBox selection bug when pressing control key

梦想的初衷 提交于 2019-12-08 19:41:57
问题 I have a very strange bug with text selection in RichTextBox : I create the following simple form : public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { richTextBox1.Text = "Tempore quo primis auspiciis in mundanum fulgorem surgeret victura dum erunt homines Roma, ut augeretur sublimibus incrementis, foedere pacis aeternae Virtus convenit atque Fortuna plerumque dissidentes, quarum si altera defuisset, ad perfectam