CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Location
    maharashtra,india
    Posts
    181

    has anybody tried this

    RTB1.TextRTF = RTB1.TextRTF & vbNewLine & strData

    RTB stands for RichTextBox
    and strData is a string containing RTB2.TextRTF, from an another form

    What i want is what ever is the Font Name, Size of RTB1 should not change &
    fonts coming from another form should b displayed in RTB1 with its own Font Name, Size

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    Code:
    Private Sub CmdMerge_Click()
    With Rtfb1
        .SelStart = Len(.Text) + 2
        .SelLength = 0
        .SelText = vbNewLine
        .SelStart = Len(.Text) + 2
        .SelLength = 0
        .SelRTF = Rtfb2.TextRTF
        .SelLength = 0
    End With
    End Sub
    
    Private Sub Form_Load()
        With Rtfb1
            .Text = "Hello, World!"
            .SelStart = 0
            .SelLength = Len(.Text)
            .SelBold = True
            .SelFontName = "Courier New"
            .SelFontSize = 10
            .SelLength = 0
        End With
        With Rtfb2
            .Text = "A lovely day for me!"
            .SelStart = 0
            .SelLength = Len(.Text)
            .SelBold = False
            .SelFontName = "Arial"
            .SelFontSize = 12
            .SelColor = vbRed
            .SelLength = 0
        End With
    End Sub
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Jul 2001
    Location
    maharashtra,india
    Posts
    181
    thanx a lot
    it works gr8

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured