• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

Rich text box

Can a user enter text in two different fonts(essentially two different languages) in a single richtext box? The user will enter text which is a combination of two different fonts which will be stored in the database. If it is not possible to do it with rich text box, what other control can be used for the above problem. Thanks in advance.
0
mkarthikeyan
Asked:
mkarthikeyan
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Using the SelFontName and SelFontSize you can format the selected text the given FontName and Size.
CHeers
0
 
Mohammed NasmanSoftware DeveloperCommented:
Hello

Here's a sample to format text in RichTextBox
Private Sub Command1_Click()
  With RichTextBox1
    .Text = "Hello World"
    .SelStart = 0
    .SelLength = 5
    .SelFontName = "Tahoma"
    .SelFontSize = 20
    .SelStart = 6
    .SelLength = 11
    .SelFontName = "Times new roman"
    .SelFontSize = 18
    .SelItalic = True
  End With
End Sub

Best regards
0
 
mkarthikeyanAuthor Commented:
Thanks it worked out. But I am having problems when I retrieve it from the database and again show in the rich text box.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now