Search Results

Search found 216 results on 9 pages for 'richtextbox'.

Page 3/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • RichTextBox Vertical Scrollbar manipulation in visual studio.

    - by PlaZmaZ
    I've searched through related questions but can't find what I need. I have a richtextbox control. I need to trigger an event when the vertical scrollbar reaches a certain position (say 90% down to the bottom). I've been playing around with the events for the rich textbox but have yet to find anything. Any help would be greatly appreciated.

    Read the article

  • [C#] RichTextBox.AutoWordSelection broken?

    - by Nilbert
    I am writing a windows forms application in C# and I create a RichTextBox (via code, not the designer). I am setting the AutoWordSelection property to false, but when I highlight stuff in the box, it still jumps to the boundaries of words, plus a space. Is this a flaw in .NET or am I doing it wrong?

    Read the article

  • Using RichTextBox SelectionTabs property in winforms

    - by Bala R
    In a winforms application, I'm using a RichTextBox and I'm trying to reduce the output from a '\t' to 4 spaces from whatever the default is. I have this in the form's OnLoad _richTextBox.Text = "1\t2\t3\t4\t5"; _richTextBox.SelectAll(); _richTextBox.SelectionTabs = new int[] {100,200,300,400 }; I have a breakpoint before and after this snippet. The SelectionTabs is set to {int[0]} (empty int array) before and after the assignment. Can anyone tell me why my assignment is not going through?

    Read the article

  • Best way to implement a Parsing/Editable Richtextbox in WPF

    - by lozzar
    I'm trying to implement (as a prototype initially), a richtextbox control which can be parsed in real time to apply certain formatting options to it. This is being done in WPF so I thought the best way to go about it would be to extend the existing rich text box control. I've run into the issue where it isn't documented well and the examples are quite slow (the ones I found have parse the whole document on every keystroke). The way I've currently decided to go about it is to create a custom Inline element which can hold the formatting tags, and the contents. Hence I only have to parse the current paragraph and the runs in that paragraph for formatting tags. Is there a better way to achieve this? Note this isn't for code/syntax based documents (so AvalonEdit isn't appropriate). Cheers

    Read the article

  • Wpf- Is there any way to disable some of the default hotkeys in a RichTextBox?

    - by Justin
    I have several keybindings in my text editing application that no longer work now that I have switched from using a regular textbox to using a richtextbox. This is because the wpf richtextbox has several default hokeys such as "Ctrl+1", "Ctrl+2", and "Ctrl+5". My keybindings are defined in a view that contains the view that the richtextbox is in. I can't move the keybindings to the richtextbox; Is there any fix for this problem? Other than using a third-party control or creating my own richtextbox from textboxbase.

    Read the article

  • Converting image to byte/encoding it? - RichTextBox

    - by user1667191
    I have strings that are "Images", although they are in "String" format. Here's how one of the strings look like: {\pict\wmetafile8\picw820\pich900\picwgoal465\pichgoal510 010009000003ac1000000000f60900000000f6090000..etc.. It goes on like this for a few more lines. The guy that got this said he converted the image by pasting it in a richtextbox and getting that string. How can I go about getting the same result? Sorry for the lack of info. Just not sure how this is called.

    Read the article

  • How do you load and save content from a Silverlight 4 RichTextBox control?

    - by AnthonyWJones
    I've been reviewing the features of the RichTextBox control in Silverlight 4. What I've yet to find is any examples of Loading and Saving content in the RichTextBox. Anyone come across any or can shed some light on it? The control has a BlocksCollection in which I guess one could use the XamlReader to load a bunch of markup assuming that markup has a single top level node of type Block. Then add that block to the Blocks collection. Seems a shame that the RichTextBox bothers to have a "collection" in this case, why not simply a top-level Block item? Never-the-less that still leaves saving the content of a RichTextBox, I have no idea where to begin with that one? I'm sure I must be missing the obvious here but unless loading and saving data in to and from RichTextBox is at least possible if not easy I can't see how we can actually put it to use. Edit Thanks to DaveB's answer I found discussion of something called the DocumentPersister. However no reference to this class can be found in the MSDN documentation nor can I find it in the installed dlls via object browser search. Anyone, anyone at all?

    Read the article

  • RichTextBox doesn't update caret position correctly

    - by shadeMe
    I have a handler consuming the keyDown event of a WinForms RTB, that has the following code: GetTextAtLoc(RTB->SelectionStart); // selects some text at the caret's position RTB->SelectedText = "SomeOfMyOwn"; GetTextAtLoc(RTB->SelectionStart); // selects the replacement string RTB->SelectionStart += RTB->SelectionLength - 1; While this code seems to do its job (SelectionStart/Length properties are updated correctly), the caret doesn't move to the end of the new string - It says right where it was at the time of GetTextAtLoc's first call. Redrawing the textbox does seem to have any effect either.

    Read the article

  • RichTextBox specific colors per few charicters / lines C#

    - by Xavier
    i have say, richTextBox1, and here is the contents: line one from my textbox is this, and i want this to be normal, arial, 8 point non-bold font line two, i want everything after the | to be bolded... | this is bold line three: everything in brackets i (want) to be the color (Red) line 4 is "this line is going to be /slanted/ or with italics and so on, basically if i know how to do what i mentioned above, ill know everything i need to know to complete my project. code examples would be very very much appricaited! :)

    Read the article

  • RichTextBox specific colors per few characters / lines C#

    - by Xavier
    I have richTextBox1, and here is the contents: line one from my textbox is this, and i want this to be normal, arial, 8 point non-bold font line two, i want everything after the | to be bolded... | this is bold line three: everything in brackets i (want) to be the color (Red) line 4 is "this line is going to be /slanted/ or with italics and so on, basically if I know how to do what I mentioned above, I'll know everything I need to know to complete my project. Code examples would be very very much appreciated! :)

    Read the article

  • Dumb RichTextBox question

    - by John Williams
    I need to get a list of tags in a text, make their contents bold, and remove them. Can't figure out how to make it. E.g. with the following input: foo [b]bar[/b] The result should be: foo bar I use the following code to extract the tags: Dim matches = Regex.Matches(OriginalRich.Text, String.Format("(\[{0}\])(.*?)(\[/{0}\])", tag), RegexOptions.IgnoreCase Or RegexOptions.Compiled) Any help would be appreciated.

    Read the article

  • How do I find the viewable area of a WPF RichTextBox?

    - by shoe
    I'm working on an app where I have a bunch of text in a RichTextBox. I'm jumping to various positions within the text, (hopping to an arbitrary paragraph for example) which seems to work by send the caret to that position but I can't seem to control where in the viewable area the caret ends up. Sometimes the caret ends up at the top of the RichTextBox and sometimes at the bottom. This would be fine if I was only interested in the line that the caret is on but I'm interested in the entire paragraph.Ideally I'd like to get the caret in the middle of the RichTextBox everytime. Unless the Paragraph is longer than the viewable area. My question. Is there a way to determine the viewable area of a RichTextBox and so do a calculation on how to position the caret properly? If I had that value I can then decided whether to put the caret in the middle (and know where the middle is) or at the top. Thanks for you help.

    Read the article

  • How to access a grid inside of a RichTextBox in Silverlight 4?

    - by benrick
    I am trying to allow a user to create a table inside of a RichTextBox. I can create a Grid inside of the RichTextBox, but I am having some issues with it. I start with this XAML in the Grid. <RichTextBox Name="TB1" AcceptsReturn="True"> <Paragraph TextAlignment="Center"> Hi everybody </Paragraph> <Paragraph> <InlineUIContainer> <Grid Background="Black"> <Grid.RowDefinitions> <RowDefinition Height="10" /> <RowDefinition Height="10" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="10" /> <ColumnDefinition Width="10" /> </Grid.ColumnDefinitions> </Grid> </InlineUIContainer> </Paragraph> <Paragraph> How are you today? </Paragraph> </RichTextBox> Then when I get the XAML out using the Xaml property of the RichTextBox I get this XAML. <Section xml:space="preserve" HasTrailingParagraphBreakOnPaste="False" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <Paragraph FontSize="11" FontFamily="Portable User Interface" Foreground="#FF000000" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" TextAlignment="Center"> <Run Text="Hi everybody" /> </Paragraph> <Paragraph FontSize="11" FontFamily="Portable User Interface" Foreground="#FF000000" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" TextAlignment="Left"> <Run /> </Paragraph> <Paragraph FontSize="11" FontFamily="Portable User Interface" Foreground="#FF000000" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" TextAlignment="Left"> <Run Text="How are you today?" /> </Paragraph> </Section> Notice here that the Grid has turned into an empty Run element. Anyone know why this happens?

    Read the article

  • How to set a RichTextBox in Silverlight 4 to fit it's parent height and maintain it on resize?

    - by Ivan Zlatanov
    I am having hard times figuring this out. Here is what I need: <StackPanel x:Name="container" VerticalAlignment="Stretch"> <RichTextBox Height="???" /> </StackPanel> Basically what I know I can do is to bind RichTextBox Height to it's parent's height ( Height="{Binding ElementName=container, Path=ActualHeight}". Unfortunately this only works on load, because as it seems ActualHeight and ActualWidth don't notify for changes. So what is the best way in Silverlight 4 to tell RichTextBox or TextBlock, it doesn't matter, to fill it's parent height, and maintain scrollbar if it's content height is bigger. Is the only way to bind some Resize events and maintain the height explicitly? That seems really ugly to me?

    Read the article

  • wrong font in a RichTextBox importing from .rtf

    - by giacomellow
    Hi all, I'm developing a microsoft surface application using expression blend+vs 2008. I have a RichTextBox that loads formatted text from an .rtf file. The text is formatted with uppecases, color, and specific font (helvetica-neue). When i load the text, it is displayed in the control with matching format (color and uppecase) but NOT matching font. it seems to use the standard Blend font (Thaoma). the text is loaded with this function: public static RichTextBox SetRTFText(string text, RichTextBox richTextBox) { MemoryStream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(text)); TextRange documentTextRange = new TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd); documentTextRange.Load(stream, DataFormats.Rtf ); return richTextBox; } thank you all!

    Read the article

  • Diving into the RichTextBox (Silverlight TV #31)

    Mark Rideout, Program Manager on the Silverlight product team, joins John to dive deep into many of the RichTextBox control's features. Mark has worked on the text aspects of Silverlight since the first version. Here are just a few of the areas that Mark covers: Overview of RichTextBox vs. TextBlock and TextBox for rich content Wire-up logic for applying formatting Inline UI elements Using text position to point for simple and complex operations   Basic "position...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • How to do Selection Alignment using the RichTextBox in Silverlight 4?

    - by RoguePlanetoid
    I cannot seem to figure out how to do a Selection Alignment in the new RichTextBox, I have an idea that I need to convert the selection into the Paragraph type which supports alignment, but cannot seem to figure this out. None of the Silverlight examples have this, but I'm sure it is possible. I have this code, that does not work - as I think I need the selection to be a Paragraph as it always returns and Exception "Value does not fall within the expected range". Editor.Selection.SetPropertyValue(Paragraph.TextAlignmentProperty, TextAlignment.Left) I make sure I check for a Valid Selection first, code like the following works for "Bold": If Editor.Selection.Text.Length > 0 Then ' Text Selected If TypeOf Editor.Selection.GetPropertyValue(Run.FontWeightProperty) Is FontWeight _ AndAlso DirectCast(Editor.Selection.GetPropertyValue(Run.FontWeightProperty), FontWeight) = FontWeights.Normal Then Editor.Selection.SetPropertyValue(Run.FontWeightProperty, FontWeights.Bold) Else Editor.Selection.SetPropertyValue(Run.FontWeightProperty, FontWeights.Normal) End If End If Editor.Focus() Example in XAML: <Paragraph TextAlignment="Right">Example</Paragraph> The above works in the contents of a RichTextBox however I need to do this programatically based on a selection - like in WordPad.

    Read the article

  • Using GetLineStartPosition to get the end of a line in WPF RichTextBox.

    - by Alan Spark
    A bit of background. I would like to be able to process text for the line that the caret is on in a WPF RichTextBox. Please see my earlier question about the TextPointer class: http://stackoverflow.com/questions/3046162/how-to-keep-track-of-textpointer-in-wpf-richtextbox. I know how to get the TextPointer at the start of the current line by using GetLineStartPosition with 0 as the argument but would now like to get the TextPointer at the end of the line. It was suggested in my previous question that this is possible using the GetLineStartPosition method. I would appreciate it if someone can explain a bit about how the GetLineStartPosition works with regard to end of line pointers. Thanks in advance for any help.

    Read the article

  • Load richtextbox from memorystream. WPF/VB>NET

    - by Peter
    Hi, I have some trouble with loading a richtextbox from a memorystream. I have some data in a database table stored as a byte array, I convert it to a string and load it into a memorystream and then I want to load that memory stream in the richtextbox. The application breaks on Dim tr As New TextRange(rtbTemplate.Document.ContentStart, rtbTemplate.Document.ContentEnd) though. Code for getting the data from the database Dim TemplateData As Byte() = TemplateDataTableInstance.Rows(0).Item("TemplateData") Dim strTemplateData As String Dim enc As New System.Text.UTF8Encoding() strTemplateData = enc.GetString(TemplateData) ' I put a messagebox here to check if I get the data I want and I do Now, how do I sort out the rest? I have Dim strDataFormat As String = DataFormats.Rtf Using ms As New MemoryStream(strTemplateData) Dim tr As New TextRange(rtbTemplate.Document.ContentStart, rtbTemplate.Document.ContentEnd) tr.Load(ms, strDataFormat) End Using and my richtextbox in xaml <RichTextBox x:Name="rtbLetter"> <RichTextBox.Resources> <Style TargetType="{x:Type Paragraph}"> <Setter Property="Margin" Value="0"/> </Style> </RichTextBox.Resources> <FlowDocument FontSize="12" FontFamily="Times New Roman"> </FlowDocument> </RichTextBox> Any help is appreciated.

    Read the article

  • How to keep track of TextPointer in WPF RichTextBox?

    - by Alan Spark
    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 to do: // The caret position before typing private TextPointer caretBefore = null; private void rtbTest_PreviewKeyDown(object sender, KeyEventArgs e) { // Store caret position caretBefore = rtbTest.CaretPosition; } private void rtbTest_PreviewKeyUp(object sender, KeyEventArgs e) { // Get text between before and after caret positions TextRange tr = new TextRange(caretBefore, rtbTest.CaretPosition); MessageBox.Show(tr.Text); } The problem is that the text that I get is blank. For example, if I type the character 'a' then I would expect to find the text "a" in the TextRange. Does anyone know what is going wrong? It could be something very simple but I've spent an afternoon getting nowhere. I am trying to embrace the new WPF technology but find that the RichTextBox in particular is so complicated that it makes even doing simple things like this difficult. If anyone has any links that do a good job of explaining the TextPointer, I would appreciate it if you can let me know.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >