Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[16] RichTextBox Control

Last post 04-24-2008 3:39 PM by mmarksbury. 26 replies.
Page 2 of 2 (27 items) < Previous 1 2
Sort Posts: Previous Next
  • 07-18-2004 10:03 PM In reply to

    hi
    i also want the same thong for my application

    if u find any answer how to do this plz let me know

    thanks in anticapation

    mtikoo
    • Post Points: 0
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 09-23-2004 5:34 AM In reply to

    Split RTF contents and print

    hi
    we used pre printed paper for printing.  so i want spilt the contents of RTF text and print it on multiple page on particular start line and end line

    pls help me

    ebi
    • Post Points: 0
  • 09-23-2004 6:03 AM In reply to

    call another form

    hi

    how can i call another form from the current MDI child form

    ebi
    • Post Points: 0
  • 09-25-2004 1:45 AM In reply to

    split rtf text

    i am very like this code. it prints all the text.  but how can extract some line from rtf.
    for e.g.  print 26 lines each from the rtf text.
    • Post Points: 0
  • 12-20-2004 2:52 PM In reply to

    Pre-formatted text/Cursor position

    How can I format text that I'm adding to the box? IE, the program prints a string into the box, and I want to change the colour of some of the text in the string. Also how can I find the cursor's position and the character it's in front of?
    • Post Points: 10
  • 07-15-2005 8:30 AM In reply to

    • ecel
    • Not Ranked
    • Joined on 07-15-2005
    • New Member
    • Points 65

    Scrolling RichTextBox

    I think its to late to answer but, maybe someone uses it , huh?


    You can use UpTo method.


    Richtextbox1.UpTo strSTRING

    it search text and goes there if there is strSTRING in richtextbox1 text. if there is no text it goes to the end.

    You must enable Vertical Scroll Bar , and then samply use

    Richtextbox1.UpTo "§"


    Note: "§"=CHR(245), i use it because , i know there is no "§" in my richtextbox control, you can use something like that who wouldnt write it to the richtextbox.


    Sorry for my english

    Keep in Peace...


    EceL sTyLe
    • Post Points: 0
  • 11-08-2005 9:51 AM In reply to

    • komarko
    • Not Ranked
    • Joined on 11-08-2005
    • New Member
    • Points 5

    RichTextBox Control - Loading and saving files

    Hi

    These days I am trying to figure out why I get another new line in a RTB when I save the contents to a file. This line is placed at the position around 68000. There are about 72000 characters in the RTB.
    I tried with FileSave method and with Open command. In both cases result was the same.

    Oh, one thing to add. The change is not visible immediately. The new line is there when the file is reopened.
    If the file is opened with WordPad the new line is there.


    Marko
    • Post Points: 0
  • 12-06-2005 4:50 PM In reply to

    • vb_lover
    • Not Ranked
    • Joined on 11-25-2005
    • New Member
    • Points 50

    can't get EM_SETTEXTMODE to respond

    James Crowley:

    I am using vb6sp6(EM_SETTEXTMODE didn't work with vb6sp4 either) RTB control, I have already implemented URL detection similar to yours.  However now i am trying to get MULTI-LEVEL UNDO to work, which you stated can be revealed with EM_SETTEXTMODE.  My attempts at setting a value(42 or any value for that matter) using EM_SETTEXTMODE(WM_USER+89) have been unsuccessful, by using EM_GETTEXTMODE(WM_USER+90) to read the value(EM_GETTEXTMODE always returns a 38).  I have previously cleared the RTB with WM_SETTEXT.  I tried SendMessageLong and SendMessage.  EM_SETTEXTMODE always returns a zero(non-error).  Can you shed some light on why this may not be working?  Can you pop an RTB control(VB6) on a form and test this again?

    Thank you
    • Post Points: 0
  • 07-31-2006 8:13 PM In reply to

    • Kylua
    • Not Ranked
    • Joined on 07-31-2006
    • New Member
    • Points 10

    Re: Pre-formatted text/Cursor position

    I spent AGES working thru this one and couldn't find it anywhere!

    The basic problem is that you have to update the richtextbox.rtf, not .text.

    And it is very fussy about goes in there!!

    A quick and dirty method is to set the richtextbox.text to a value such as "WHATEVER" and then replace that in the richtextbox.rtf with your rtf enabled code.  As for what .rtf recognises in formatting, I resorted to copying and pasting rtf into the richtextbox and then looking at the .rtf value.

    I only wanted a bit of bold!!  By the time I had sorted it out I had decided on a different display method anyway so I hope someone uses this so I haven't wasted my time!!

    The working code from my project, before I dump it:

    richtextbox.Text =

    "REPLACETHIS"

    Do While Not EOF(1)
    Input(1, aLine)
    info = Split(Replace(aLine,

    "\", "\\"), ",")
    TempInfo = TempInfo &
    "\b Result Displayed: \b0" & info(1) & " \par " & "\b URL: \b0 " & info(0) & " \par " & "\b Interval: \b0 " & info(2) & " \par " & "\b Log Path: \b0 " & info(3) & " \par " & " \par "

    Loop

    richtextbox.Rtf = Replace(richtextbox.Rtf, "REPLACETHIS", TempInfo)

    I've just done bolds and replaced the slashes as I was showing URLs and file paths.

    • Post Points: 10
  • 09-21-2006 5:48 PM In reply to

    • Verdi
    • Not Ranked
    • Joined on 09-21-2006
    • New Member
    • Points 5

    Re: Pre-formatted text/Cursor position

    Kylua, your efforts were not wasted...

    You have probably saved me a week's worth of head-pounding. Why it is so difficult to programmatically modify RTF using this control is beyond me. All of the examples I have seen rely on the .Find method to select the text you want to modify.

    I am still going to learn the intricacies of RTF and what the difference is between a replace and simply assigning a string. Maybe there's some hidden header we can't see in the RTF property that an assignment overwrites but a replace does not.

    Anyway, thanks for sharing this! Big Smile [:D]

    • Post Points: 5
  • 01-06-2007 7:18 PM In reply to

    • magiel
    • Not Ranked
    • Joined on 04-30-2006
    • Netherlands
    • New Member
    • Points 10

    Re: Read Only Property

    I am had the same proplems;

    RichTextBox1.SelectionFont.Bold
    RichTextBox1.SelectionFont.Underline etc are readonly

    Solved them the following way

    Me.RichTextBox1.SelectionColor = Color.Blue

    Me.RichTextBox1.SelectionFont = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold)

    Me.RichTextBox1.SelectedText = BlueBoldText

    Me.RichTextBox1.SelectionColor = Color.Black

    Me.RichTextBox1.SelectionFont = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular)

    Me.RichTextBox1.SelectedText = BlackRegularText

    • Post Points: 10
  • 04-24-2008 3:39 PM In reply to

    • mmarksbury
    • Not Ranked
    • Joined on 04-24-2008
    • United States
    • New Member
    • Points 5

    Re: Read Only Property

    This is long past the topic post date but...

     I used the selection method (where you select text and then update it), for formatting the output of an application's process in a RTF.  This worked great until I needed to buffer the contents of the RTF.  Once I started removing content from the RTF, the formatting I had applied through the selection method caused other text to be come improperly formatted.

    I am now proceeding with the inserting text as RTF method.
     

    • Post Points: 5
Page 2 of 2 (27 items) < Previous 1 2