richtextbox

How to save RichTextBox content in Access2010

荒凉一梦 提交于 2019-12-20 03:55:18
问题 I'm creating a dictionary system, where words meaning is editable in RichTextBox (for user define FontSize, Color, etc...) So how to can I save meaning RichTextBox content in the Access database in RTF format? And how to can I read this? 回答1: Native Rich text in Access 2007/2010/2013 uses a subset of HTML, not RTF, so unless you want to convert to/from RTF<>HTML when you load/save your data, you will have to find another way to store your formatted text. Since the WPF RichText control uses

How can I create an html input text area such that I can underline or format certain words?

为君一笑 提交于 2019-12-20 03:55:08
问题 I'd like an input field that I can have javascript set certain attributes for, for different parts of the input field. A simple example to demonstrate what I'd like to do: let's say I want to underline all curse words in an input text area. So the javascript would check the input text area when a new letter is inserted, and for any words matching my array of recognized curse words, it would underline the word. Note, I do not want the user/client to be able to set any attributes of the text, I

Check if selected text on richtextbox is all bold or not

戏子无情 提交于 2019-12-20 02:12:19
问题 How to check if selected text on richtextbox is all bold. For example: asdasd asd asd ← this is not all bold Im all bold ← this is all bold This is the code I have made, it can check if its all bold or not but its slow because its checking the char one by one using Selection.Start to Selection.Length and check if bold. bool allbold = true; int start = richTextBox1.SelectionStart; int end = richTextBox1.SelectionLength; for (int i = 1; i < end; i++) { richTextBox1.SelectionStart = start+i;

WPF Richtextbox Application.Find Text spanning Multiple runs

柔情痞子 提交于 2019-12-20 01:36:55
问题 I'm trying to implement the Application.Find command for the WPF richtextbox. Let's say I'm searching for "expert". Sounds easy enough. But due to the nature of wpf, if every other letter in "expert" is bolded, then the richtextbox contains e* x *p* e *r* t * and that means six runs exist. I have a starting textPointer. What I'm trying to figure out is how to get the ending textPointer so that I can create a TextRange that I can use to create the Selection. In this example, the starting

Breaks encoding in richtextbox

て烟熏妆下的殇ゞ 提交于 2019-12-19 17:33:04
问题 I use richtextbox in my winform application. When I paste "ជំរាបសួរ Khmer" text all good: But when I paste "'مرحب Arabic" text some problems appear: in the first insert having problems with the encoding: I have not found any Enсoding properties in richtextbox. How do I solve the problem of encoding? 回答1: Use RichTextBox v5. The default in Visual Studio is v4. It fixes this problem among others. public class RichText50W : RichTextBox { [DllImport("kernel32.dll", CharSet = CharSet.Auto)] static

How to get a WPF rich textbox into a string

与世无争的帅哥 提交于 2019-12-19 15:34:13
问题 I saw how to set a WPF rich text box in RichTextBox Class . Yet I like to save its text to the database like I used to, in Windows Forms. string myData = richTextBox.Text; dbSave(myData); How can I do it? 回答1: At the bottom of the MSDN RichTextBox reference there's a link to How to Extract the Text Content from a RichTextBox It's going to look like this: public string RichTextBoxExample() { RichTextBox myRichTextBox = new RichTextBox(); // Create a FlowDocument to contain content for the

Preventing a RichTextBox operation from being added to the control's Undo stack

戏子无情 提交于 2019-12-19 12:04:04
问题 Editing a RichTextBox control's text (more specifically, modifying selection font/color) programmatically seems to be tracked in the control's built in undo stack. Is there a way, short of writing my own undo/redo "manager", to prevent certain actions/operations from being added to the undo stack ? 回答1: No cando. At best you can flush the undo stack completely by sending EM_SETUNDOLIMIT twice. EM_SETTEXTEX offers the same option with the ST_DEFAULT flag. Surely not what you want. Look at

Rich Text in ToolTip for C#

徘徊边缘 提交于 2019-12-19 09:01:10
问题 I can extend the ToolTip and create my own RichToolTip but I don't understand how I can handle formatting per line or Per word. Can I add controls which a user can click on ? or images etc. I came across RichTextBox but this is written in C++ (MFC) & I want something for C# or something which I can use with C#. Any suggestions? Are there any open source components which I can use? public class RichToolTip : ToolTip { public RichToolTip() { this.OwnerDraw = true; this.Draw += new

transparent richTextBox

空扰寡人 提交于 2019-12-19 06:43:15
问题 how can I make my richtext box transparent I want this cuz I am trying to put a text on top of a graphic image (which is the background of my form). That is why I wanted the richTextBox to be transparent, I am using .NET ,c# and in a windows form application 回答1: There is no such thing as true transparency in a WinForms Control. Transparent mode inherits the default background of its parent. The way I have worked around it in the past has been to use the OnPaint event and then use the

transparent richTextBox

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-19 06:41:27
问题 how can I make my richtext box transparent I want this cuz I am trying to put a text on top of a graphic image (which is the background of my form). That is why I wanted the richTextBox to be transparent, I am using .NET ,c# and in a windows form application 回答1: There is no such thing as true transparency in a WinForms Control. Transparent mode inherits the default background of its parent. The way I have worked around it in the past has been to use the OnPaint event and then use the