richtextbox

WPF RichTextBox SpellCheck ComException

时间秒杀一切 提交于 2019-12-08 17:00:55
问题 I've got an exception while trying to enable spell checking on some Windows 8.1 machines (both have latest updates, OS language is russian and .NET framework 4.7 is russian) saying: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Invalid value for registry (Exception from HRESULT: 0x80040153 (REGDB_E_INVALIDVALUE)) at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD) at

How to display html text within a Wicket element?

こ雲淡風輕ζ 提交于 2019-12-08 15:11:36
问题 i'm trying to display html i.e. rich text within a wicket element dynamically. An example is like displaying a rich text email within a div tag. how can i get this done with wicket. the wicket Label component doesn't seem to support this. is there a component that does 回答1: Found this in the excellent Manning Wicket in Action: add(new Label("markup", "<h1>Hello!</h1>").setEscapeModelStrings(false)); The call to setEscapeModelStrings tells Wicket not to escape the contents of the provided

Saving/Loading RichTextBox Content with other data using C#

99封情书 提交于 2019-12-08 14:28:15
问题 I am currently trying to figure out how to save the content from a RichTextbox into a stream(currently using FileStream) and do this alongside a bunch of other data. Then of course I want to be able to load from this file. I was currently trying to use something along the following lines. FileStream stream = new FileStream(); //this is actually correctly defined. ASCIIEncoding encoding = new ASCIIEncoding(); //write Title byte[] array = encoding.GetBytes(Title); stream.WriteByte(Convert

how to remove spacing in the richtextbox?

孤人 提交于 2019-12-08 13:34:54
问题 question relevant to this question, I want to remove the spacing in my richtextbox since the display will always include a spacing like: Hello Hello Hello I want to modify the code that will display this texts as: Hello Hello Hello How would I do that? Anyone knows? Thanks Here is the code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using

Using Dispatcher with thread

99封情书 提交于 2019-12-08 12:56:38
问题 I have a list of rtf strings that are needed to convert to html. I am using a richtextbox control to convert rtf to html. My problem is this The solution should also work but how do i implement this solution in my code? public string ConvertRtfToHtml(string rtfText) { try { var thread = new Thread(ConvertRtfInSTAThread); var threadData = new ConvertRtfThreadData { RtfText = rtfText }; thread.SetApartmentState(ApartmentState.STA); thread.Start(threadData); try { thread.Join(); } catch

RichTextBox selection and selection color not working

早过忘川 提交于 2019-12-08 09:18:08
问题 I have a method that detects the username, highlights it and changes it's color and then puts it in the RichTextBox: private void displayMessage(string message, string color) { string username = message.Substring(0, message.IndexOf(':') - 1); string realMessage = message.Replace(username , ""); serverChat.Text += message; serverChat.Select(((serverChat.Text.Length - message.Length) - 1), username.Length - 1); serverChat.SelectionColor = getColor(color); serverChat.Text += Environment.NewLine;

How to change RichTextBox line endings from Lf to CrLf

♀尐吖头ヾ 提交于 2019-12-08 08:24:56
问题 As opposed to the TextBox control which use CrLf line endings the RichTextBox control use Lf line endings. I don't want that. I need consistency. I need a RichTextBox control whom use CrLf line endings. I opened the control in reflector and noticed that the getter of the Text property calls the following function: Private Function StreamOut(ByVal flags As Integer) As String '... Me.StreamOut(data, flags, False) '... End Function Which ends up calling: Private Sub StreamOut(ByVal data As

Open PDF file in RichTextBox in WPF

江枫思渺然 提交于 2019-12-08 07:40:53
问题 Can I open a PDF file in RichTextBox? 回答1: Short answer: No. Longer answer: No. A RichTextBox is for displaying rich text. PDFs can contain anything including text, but that's not the document model underlying the RichTextBox. Besides, WPF does not handle PDF natively. There are third-party controls, however. This question also has some pointers which may be of use to you, albeit not using a RichTextBox. 回答2: You need to use the Acrobat Control for ActiveX or at least the Adobe Reader 9

How can I move the caretposition programatically in a RichTextBox?

ε祈祈猫儿з 提交于 2019-12-08 07:00:27
问题 I have a RichTextBox with custom formatting on special bits of text in it. However there is a bug where after a character is inserted, the caret is placed before the newly inserted character instead of after. This is because for every edit, the code recalculates the content to apply the custom formatting and then sets the CaretPosition like so... protected override void OnTextChanged(TextChangedEventArgs e) { base.OnTextChanged(e); currentPos = CaretPosition.GetNextInsertionPosition

Set a selection of text to bold inside a RichTextBox

爷,独闯天下 提交于 2019-12-08 06:57:01
问题 In an MS-Access RichTextBox on a Report, I want to make a selection of the text bold. I found this post on a forum which explains how to do this in VB6. I tried the same in MS-Access, both with a normal Access textbox with the Text Format property set to Rich Text and a Microsoft Forms 2.0 TextBox added via the ActiveX Controls dialogue box, neither works. I know VBA is based heavily on VB6 so my logic is if it can be done in VB6, I should be able to do it in Access. Am I right? Is it