Search Results

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

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

  • In WPF RichTextBox, does overriding of Underline/Strikethrough work?

    - by Daniel Earwicker
    In a WPF RichTextBox, the effective style of a Run of text is a result of combining the properties defined on the Run with the properties it "inherits" from the enclosing Paragraph and finally the styles on the Document. So you can set FontWeight to Bold at any of those levels. You can also set it Bold on the Paragraph and then switch it to Normal (override it) for a specific Run. However, underline and strikethrough are different. They are items that can optionally appear in a list of TextDecorations, which is a property of Inline (and hence Run) and of Paragraph, but not of Document. And you can switch on Underline in the Paragraph, and it gets inherited so that all Runs within that Paragraph default appear underlined by default. Is it possible to switch it off underline in a specific Run? i.e. is there a way to insert an entry into the list of TextDecorations which would mean "Don't underline", thus overriding the Paragraph's setting?

    Read the article

  • how to add text in a created table in a richtextbox?

    - by francops henri
    I created a table in richtextbox like this : //Since too much string appending go for string builder StringBuilder tableRtf = new StringBuilder(); //beginning of rich text format,dont customize this begining line tableRtf.Append(@"{\rtf1 "); //create 5 rows with 3 cells each for (int i = 0; i < 5; i++) { tableRtf.Append(@"\trowd"); //A cell with width 1000. tableRtf.Append(@"\cellx1000"); //Another cell with width 2000.end point is 3000 (which is 1000+2000). tableRtf.Append(@"\cellx2000"); //Another cell with width 1000.end point is 4000 (which is 3000+1000) tableRtf.Append(@"\cellx3000"); //Another cell with width 1000.end point is 4000 (which is 3000+1000) tableRtf.Append(@"\cellx4000"); tableRtf.Append(@"\intbl \cell \row"); //create row } tableRtf.Append(@"\pard"); tableRtf.Append(@"}"); this.misc_tb.Rtf = tableRtf.ToString(); Now I want to know how I can put text in headers and in each cells. Do you have an idea? Thanks

    Read the article

  • Get XAML from WPF Custom RichTextFormat

    - by Erika
    I've looked at other posts, but i cant seem to find something that works. I have a custom control WPF RichTextBox and would like to obtain the XAML from this control. I have tried the following //rt is the name of this particular custom richtextbox TextRange range = new TextRange(rt.Document.ContentStart, rt.Document.ContentEnd); MemoryStream stream = new MemoryStream(); range.Save(stream, DataFormats.Xaml); string xamlText = Encoding.UTF8.GetString(stream.ToArray()); return xamlText; but this doesnt seem to work :s I can access the rt.Document.Content start etc but it seems to crash there "Object Reference not set to instance of an object". I am using the richtextbox directly from the .xaml.cs so it should be initiated and so on :s. Any Ideas or other ways to get the XAML from a richtextbox pls? (i'm requiring the XAML cos i actually want to get the HTML.. if theres some other direct manner perhaps?)

    Read the article

  • Want to show file association icon and skype like progress bar c#

    - by Thomas
    whenever user drag any file onto skype chat textbox then skype show right icon for that file and one custom progress bar rounded corner. i have 4 questions 1) i am working with win application not WPF. i like to know how to develop skype like corner progressbar. i search lot google to find out skype like progressbar. so if anyone knows how to develop that kind of progress bar then please share that knowledge or give me any url from where i can download similar look progressbar. 2) when i drag any file onto my richtextbox then how could i show right icon for that file on my richtextbox. anyone can give me idea. 3) what kind of richtextbox skype use? is there any advance richtextbox library which i can use for showing picture or button etc. 4) skype shows button on chat textbox called Cancel......is it button or any image. when user click on that button then button respond accordingly. so just tell me how could place any button on my rich textbox and when i will click on that button then a event should fire at my end. any idea. here i attach a picture from where you can see the image of progressbar that i am looking for. how i want to show the progress button and file associated icon on richtextbox. the object behind attaching the image is other person can understand what is my requirement and what i want to know. please anyone give me the idea for my above 4 points. thanks

    Read the article

  • Saving formatted text from richtextbox

    - by phenevo
    Hi, Is there any way, to save formatted in database from richtextbox? I've got richtextbox and some parts of text in this are bold. string s=richtextbox.Text obviously doesn't work. And If I can get this formatted text how to save it in Ms Sql Server 2005 ?

    Read the article

  • InlineUIControl

    - by zync
    Hi. I have a project in wich I must create a form editor (just like infopath) using wpf. For this I thought to use a RichTextBox and in there I would place InlineUIElements with the different controls (TextBox, ComboBox, etc.). The problem is that I can't change some properties associated with those controls. Here's some XAML: <RichTextBox> <FlowDocument> <Paragraph> <InlineUIContainer> <TextBox Background="Red">Some Text</TextBox> </InlineUIContainer> </Paragraph> </FlowDocument> </RichTextBox> This displays a TextBox in a RichTextBox just like I wanted but it's not red. Some other properties work like width and height. Why is this and how can I make it work? Other question is: Am I approaching the problem (creating the form editor) right? Thanks

    Read the article

  • DataGridTemplateColumn for individual control-column vs DataGridTextColumn

    - by msfanboy
    Hello, what is the difference, both works: DataGridTemplateColumn versus DataGridTextColumn <DataGridTemplateColumn Header="Homework"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <RichTextBox > <FlowDocument> <Paragraph> <Run Text="{Binding Homework}"/> </Paragraph> </FlowDocument> </RichTextBox> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTextColumn Header="Homework"> <DataGridTextColumn.CellTemplate> <DataTemplate> <RichTextBox > <FlowDocument> <Paragraph> <Run Text="{Binding Homework}"/> </Paragraph> </FlowDocument> </RichTextBox> </DataTemplate> </DataGridTextColumn.CellTemplate> </DataGridTextColumn >

    Read the article

  • Bind a WPF combobox and get selecteditem to a richtextbox

    - by Peter
    Hi, I am using a dataset on the server, in this dataset I have a datatable that calls a stored procedure and returns column names from three tables. I call this stored procedure using a web service. I manage to show all the column names in my combobox but when I want to click a button and insert selected column name into a richtextbox I get System.Data.DataRowView in the textbox instead. My code: 'the combobox 'if I don't have this textblock all the values are shown vertical instead of the normal horizontal lines 'the stored procedure SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE (TABLE_NAME = 'Customer') OR (TABLE_NAME = 'Invoices') OR (TABLE_NAME = 'Orders') 'the button Private Sub btnAddColumnNames_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnAddColumnNames.Click ' Add column names to the richtextbox Dim tr As New TextRange(rtbText.Selection.Start, rtbText.Selection.End) tr.Text = cboColumnNames.SelectedItem.ToString() rtbText.Focus() End Sub Any suggestions on how to get the selected text in the combobox to the richtextbox? Any help is appreciated.

    Read the article

  • Edit and render RichText

    - by OregonGhost
    We have an application (a custom network management tool for building automation) that supports printing labels that you can cut out and insert into the devices' front displays. In earlier versions of the tool (not developed in my company), the application just pushed the strings into an Excel file that the field technician could then manipulate (like formatting text). We didn't do this in the new version because it was hard (impossible) to keep the Excel file in sync, and to avoid a binding to an external application (let alone different versions of Excel). We're using PDFSharp for rendering the labels. It has a System.Drawing-like interface, but can output to a System.Drawing.Graphics (screen / printer) as well as to a PDF file, which is a requirement. Later, basic formatting was introduced like Font Family, Style, Size, Color which would apply to one label (i.e. to exactly one string). Now the customer wants to be able to apply these formats to single characters in a string. I think the easiest way would be to support a subset of RichText. It's not as easy as I thought though. Currently the editor just displays a TextBox for the label you want to edit, with the font set to the label's font. I thought I'd just replace it with RichTextBox, and update the formatting buttons to use the RichTextBox formatting properties. Fairly easy. However, I need to draw the text. I know you can get the RichTextBox to draw to a HDC or System.Drawing.Graphics - but as already said, I need it to use PDFSharp. Rendering to bitmaps is not an option, since the PDF must not be huge, and it's a lot of labels. Unfortunately I couldn't get the RichTextBox to tell me the layout of the text - I'm fine with doing the actual rendering by hand, as long as I know where to draw what. This is the first question: How can I get the properly layouted metrics of the rich text out of a RichTextBox? Or is there any way to convert the rich text to a vector graphics format that can be easily drawn manually? I know about NRTFTree which can be used to parse and manipulate RichText. The documentation is bad (actually I don't know, it's Spanish), but I think I can get it to work. As far as I understood, it won't provide layouting as well. Because of this, I think I'll have to write a custom edit control (remember, it's basically just one or two line labels with basic RTF formatting, not a full-fledged edit control - more like editing a textbox in PowerPoint) and write custom text layout logic that used PDFSharp rather than System.Drawing for drawing. Is there any existing, even if partial, solution available, either for the editing or for doing the layout manually (or both)? Or is there an entirely different approach I'm just not seeing? Bonus points if exporting the label texts as RTF into a CSV file, and then importing in Excel retains the formatting. For the editing part, I need it to work in Windows Forms. Other than that it's not Windows-Forms-related, I think.

    Read the article

  • Problem with InlineUIContainer

    - by paradisonoir
    I have an Windows.Documents.InlineUIContainerin a RichTextBox, and sometimes it's font size of alignment change when I hit key combination such as Ctrl+Space. I couldn't find any place to handle these events and block them somehow. I don't want to block it in the RichTextBox. I am more looking for a way to block it only on the InlineUIContainer.

    Read the article

  • richtextbox dosn't support arabic

    - by mohamed
    hi all when i replace english characters in richtextbox with arabic characters, it appears to be question marks instead of the arabic characters. but when i try to write in the richtextbox directly with arabic, it accepts is there is any solution for the problem of replacing? thanks in advance.

    Read the article

  • I'm trying to use a regular expression to retrieve text from RichTextBox

    - by Simon
    Hello! As the header is implying I'm trying to retrieve a certain line of numbers from a richtextbox and then put it into a separate textbox. I've tried this code below but it doesn't wanna work with me. It's probably way wrong and there's probably easier ways of doing it but I'm quite new to this stuff and I would appreciate all the help I can get in this matter. I have a textbox called tbPersNr; A RichTextBox called tbText; A button which is called btnGet; string regPattern = @"\\d{6}-\\d{4}"; int indexOfSearch = 0; private void btnGet_Click(object sender, EventArgs e) { int startIndex = 0; if (tbText.Text.Length > 0) { startIndex = HittaPersNr(regPattern, startIndex, tbText.Text.Length); } if (startIndex > 0) { this.tbPersNr.Text = regPattern.ToString(); } } public int HittaPersNr(string txtToSearch, int searchStart, int searchEnd) { // Setting default value to -1. int retVal = -1; // Validating start of the search // om indexOfSearch = -1, slutar sökningen if (searchStart >= 0 && indexOfSearch >= 0) { // Validating end of search if (searchEnd > searchStart || searchEnd == -1) { // Searching for results in richtextbox indexOfSearch = tbText.Find(regPattern, searchStart, searchEnd, RichTextBoxFinds.None); // Validating if search resulted in any finds. if (indexOfSearch != -1) { // putting index to value in the text. retVal = indexOfSearch; } } } return retVal; } } } Cheers

    Read the article

  • Understanding RTF and edit it with vb.net

    - by Jacob Kofoed
    I have this RichTextbox in my vb.net form and I would like to when a user click a button, for example to embold the selected text, how would I do this. Also, I do NOT want to use the standard vb.net expressions such as RichTextBox1.SelectedText.Font.Bold = true. I want to do something like RichTextbox1.SelectedRTF="[bold]" & RichTextBox1.SelectedRTF & "[/bold]" or whatever RTF looks like. Can I just add the RTF options random places or can a RichTextBox return an error if the text is in wrong format. I'm mostly looking for info on how to work with RTF without using the standard vb expressions. Thank you very much for any help provided

    Read the article

  • An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll

    - by Tanner
    OK, Im trying to highlight keywords in a richtextbox, the problem is I've got the code to highlight only the visible text on textChanged event,so I tryed putting the code in the richtextbox VScroll, so when I scrolled up it would highlight the text that wasn't visible before, but every time I start to scroll I get this error: "An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll" Does any one know why? Or maybe a way I could highlight the words while scrolling? Thanks, Tanner. int selectionstart = richTextBox1.Selectionstart; int topIndex = richTextBox1.GetCharIndexFromPosition(new Point(1, 1));//This is where I get the error. int bottomIndex = richTextBox1.GetCharIndexFromPosition(new Point(1, richTextBox1.Height - 1)); int topLine = richTextBox1.GetLineFromCharIndex(topIndex); int bottomLine = richTextBox1.GetLineFromCharIndex(bottomIndex); int start = richTextBox1.GetFirstCharIndexFromLine(topLine); int end = richTextBox1.GetFirstCharIndexFromLine(bottomLine); int numLinesDisplayed = (bottomLine - topLine) + 2; richTextBox1.Focus(); richTextBox1.Select(start, end);

    Read the article

  • Graphical net and text

    - by chesheerkys
    Hello! My task is to make a control, that behaves itself like RichTextBox, but contains a graphical net. The only task, this net is solving, is to be visible. It should be solution in overriding OnPaint method, but it doesn't. This code: protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { base.OnPaint(e); ...//drawing a line } gives me RichTextBox without of text This code: protected override void WndProc(ref System.Windows.Forms.Message m) { base.WndProc(ref m); if (m.Msg == 15) { Graphics g = this.CreateGraphics(); g.DrawLine(new Pen(Color.White, 1), new Point(0, 0), new Point(400, 400)); } } sometimes draws extra lines Actually since these two ways don't work, I don't know what to try. Waiting for your advices :) BR Dmitry P.S. I’ve heard a lot about great opportunities of WPF, but I’m not really common with this technology and don’t know what to start with. P.P.S. Sorry for my English, it’s not my natural language.

    Read the article

  • Compare GetNextInsertionPosition and GetNextContextPosition in WPF

    - by paradisonoir
    As I enter a character in my RichTextBox, I want to get the next character from the its TextRange. So here is how I do it: TextPointer ptr1= RichTextBox.CaretPosition; char nextChar = GetNextChar(); while (char.IsWhiteSpace(nextChar)) { ptr1= ptr1.GetNextInsertionPosition(LogicalDirection.Forward); nextChar = GetCharacterAt(Ptr1); } then I get the ptr1 of the next character and from the TextPointer, I get the TextRange, and do my changes. So here is the problem? when the next word is spelled correctly, I have no problem, but if it's not spelled properly then ptr1 would not point to the first character of the next word (the second character), and if I use GetNextContextPosition(LogicalDirection.Forward) it would give me the first letter of the next word if it's misspelled. So depending on the spelling only one of them works? I was just wondering if you have any idea about this problem? Is there anything wrong I am doing here?

    Read the article

  • XAML to HTML Conversion - WPF RichTextBox

    - by Erika
    I have the problem where i have a WPF RichTextBox, and i'm extracting its XAML code and saving it to a txt file. When i copy paste the XAML code generated to a XAMLtoHTML converter like this http://blogs.msdn.com/wpfsdk/archive/2006/05/25/606317.aspx , some error must be occuring as i'm always getting a blank result! If i write test in the RichTextBox i get the following XAML: <Section xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve" TextAlignment="Left" LineHeight="Auto" IsHyphenationEnabled="False" xml:lang="en-us" FlowDirection="LeftToRight" NumberSubstitution.CultureSource="Text" NumberSubstitution.Substitution="AsCulture" FontFamily="Segoe UI" FontStyle="Normal" FontWeight="Normal" FontStretch="Normal" FontSize="12" Foreground="#FF000000" Typography.StandardLigatures="True" Typography.ContextualLigatures="True" Typography.DiscretionaryLigatures="False" Typography.HistoricalLigatures="False" Typography.AnnotationAlternates="0" Typography.ContextualAlternates="True" Typography.HistoricalForms="False" Typography.Kerning="True" Typography.CapitalSpacing="False" Typography.CaseSensitiveForms="False" Typography.StylisticSet1="False" Typography.StylisticSet2="False" Typography.StylisticSet3="False" Typography.StylisticSet4="False" Typography.StylisticSet5="False" Typography.StylisticSet6="False" Typography.StylisticSet7="False" Typography.StylisticSet8="False" Typography.StylisticSet9="False" Typography.StylisticSet10="False" Typography.StylisticSet11="False" Typography.StylisticSet12="False" Typography.StylisticSet13="False" Typography.StylisticSet14="False" Typography.StylisticSet15="False" Typography.StylisticSet16="False" Typography.StylisticSet17="False" Typography.StylisticSet18="False" Typography.StylisticSet19="False" Typography.StylisticSet20="False" Typography.Fraction="Normal" Typography.SlashedZero="False" Typography.MathematicalGreek="False" Typography.EastAsianExpertForms="False" Typography.Variants="Normal" Typography.Capitals="Normal" Typography.NumeralStyle="Normal" Typography.NumeralAlignment="Normal" Typography.EastAsianWidths="Normal" Typography.EastAsianLanguage="Normal" Typography.StandardSwashes="0" Typography.ContextualSwashes="0" Typography.StylisticAlternates="0"><Paragraph><Run>test</Run></Paragraph></Section> pleaseee help!! Any Ideas?

    Read the article

  • Disable Painting of the VScrollbar in a System.Windows.Forms.RichTextBox

    - by SchlaWiener
    I have a custom control inherited from RichTextBox. This control has the ability to "disable" rich text editing. I achive this by just setting the Rtf property to the text property during the TextChanged event. this is how my code looks like: private bool lockTextChanged; void RichTextBox_TextChanged(object sender, EventArgs e) { // prevent StackOverflowException if (lockTextChanged) return; // remember current position int rtbstart = rtb.SelectionStart; int len = rtb.SelectionLength; // prevent painting rtb.SuspendLayout(); // set the text property to remove the entire formatting. lockTextChanged = true; rtb.Text = rtb.Text; rtb.Select(rtbstart, len); lockTextChanged = false; rtb.ResumeLayout(true); } That worked well. However in a large text with like 200 lines the controls jitters (you see the first lines of text for the wink). To prevent that from happening I filter the WM_PAINT between SuspendLayout() and ResumeLayout() private bool layoutSuspended; public new void SuspendLayout() { layoutSuspended = true; base.SuspendLayout(); } public new void ResumeLayout() { layoutSuspended = false; base.ResumeLayout(); } public new void ResumeLayout(bool performLayout) { layoutSuspended = false; base.ResumeLayout(performLayout); } private const int WM_PAINT = 0x000F; protected override void WndProc(ref System.Windows.Forms.Message m) { if (!(m.Msg == WM_PAINT && layoutSuspended)) base.WndProc(ref m); } that did the trick, the RichTextBox isn't jittering anymoe. That's what I wanted to achive, except one thing: The scrollbar is still jittering everytime I type text to my control. Now my question: Does anyone have a clue for me how to prevent the scrollbar from redrawing during Suspend/Resume Layout?

    Read the article

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