[VB.net-WINAPP] -StringBuilder Change font-style

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zubair1
    New Member
    • Sep 2008
    • 79

    [VB.net-WINAPP] -StringBuilder Change font-style

    Hello,

    Could some body please tell me how i can change the fonts style of a stringbuilder string at runtime.

    Example:

    Code:
    Function myFun () as string
       Dim MyOutput As New System.Text.StringBuilder("")
    
       'I want to change the font or font-color of the String "Hello"
       MyOutput.append("Hello")
       MyOutput.appendLine()
       MyOutput.append("World")
    
       Return MyOutput.ToString
    End Function
    Textbox1.text = MyOutput()

    Could some one tell me how i can do this - i want the string "Hello" to be blue when it gets outputted or make it Bold.

    I can't find anything that can let me do this :(

    Any Help is highly apprecaited :)
    Regards
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    You would probably need to use a Rich Text Box, and set the RTF code as part of your string.

    Comment

    • zubair1
      New Member
      • Sep 2008
      • 79

      #3
      Thanks InsertAlias

      But do you think there will be a performance differnce ? will my app load slower?

      also, is it possible if you could provide some small snippet on how to do this

      Thanks
      Regards

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Never tried, so I can't give you any code.

        But a standard text box isn't capable of what you want, so it doesn't really matter if a RichTextBox will slow it down...you can't use a standard one :P

        Comment

        Working...