Skip to content

VB 2008 Funtext The Begining :)

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #187441
    Admin
    Administrator

    Well I am here trying to make a funtext under VB 2008 thanks to Autos tutorial here
    vb-2008-paltalk-integration-t31230.html
    I am up to a great start, but I have a damn issue with rezizing fonts cause every time I change the font size with this code
    Me.RichTextBox1.Font = New Font(Me.RichTextBox1.Font.FontFamily, 8)
    The damn thing changes the font size but also remotes every other style I had apply like color, boldness 🙄
    here what I got so far, its just the begining lol

    #187451
    Chike
    Member

    Try

    Me.RichTextBox1.Font = New Font(Me.RichTextBox1.Font.FontFamily, 8, Me.RichTextBox1.Font.Style)
    #187450
    Admin
    Administrator

    thanks but the same thign happens, when i change fonts from one size to the other i takes the others styles away 🙄

    #187449
    Chike
    Member

    I see, because you apply style to selection only, but you want the size for all the text.
    So you have 2 choices, either apply the size to selection only, or, go over the text and apply size to different styles seperately.

    #187448
    Admin
    Administrator

    How chike 🙂 and here how its looking so far, I even added the color fader :mrgreen:

    #187447
    Chike
    Member

    @Admin wrote:

    How chike 🙂

    Like in a loop. What you want me to write the code?
    First you need to define what you want, one size to all text or selection/new text only.
    BTW it’s quite annoying that when you change size/style/color the text lose focus.
    And how do you remove bold? And what about italic?

    #187446
    Admin
    Administrator

    Is like when I first higlight the text then apply the bold style, then I try to rezize it to bigger letter size then it looses its boldness 🙂 and man I am liking VB 2008 I though it was goona be hard to upgrade programs buts is mad easy.

    #187445
    autopilot
    Member

    if i understand what you want to do, you want to use .SelectionFont like this example


    Me.RichTextBox1.SelectionFont = New Font("Arial", 8, FontStyle.Bold)
    Me.RichTextBox1.SelectionColor = Color.Blue
    Me.RichTextBox1.AppendText("H")
    Me.RichTextBox1.SelectionFont = New Font("Arial", 14, FontStyle.Bold)
    Me.RichTextBox1.SelectionColor = Color.Brown
    Me.RichTextBox1.AppendText("E")
    Me.RichTextBox1.SelectionFont = New Font("Arial", 22, FontStyle.Bold)
    Me.RichTextBox1.SelectionColor = Color.ForestGreen
    Me.RichTextBox1.AppendText("L")
    Me.RichTextBox1.SelectionFont = New Font("Arial", 16, FontStyle.Bold)
    Me.RichTextBox1.SelectionColor = Color.Red
    Me.RichTextBox1.AppendText("L")
    Me.RichTextBox1.SelectionFont = New Font("Arial", 8, FontStyle.Bold)
    Me.RichTextBox1.SelectionColor = Color.Pink
    Me.RichTextBox1.AppendText("O")

    and if you need to combine multiple font styles such as bold and italic, see the following example


    Dim myStyle As FontStyle
    myStyle = FontStyle.Bold + FontStyle.Italic
    Me.RichTextBox1.SelectionFont = New Font("Arial", 8, myStyle)
    #187444
    Chike
    Member

    In fact you’re going to have the same problem if you try to apply a new style to a sellection with mixed styles (e.g applying italic to a selection with plain and bold text)

    Note that style manipulation should be done using bitwise or/and and not with +/-.

    #187443
    Admin
    Administrator

    WTF, they made it more complecated on vb 2008 🙂 but I will get it, now the program is gonna bigger, I gonan put all of it admin bot, music bot, all the crap in one 🙂

    #187442
    wazzzup
    Member

    yeah good job Admin… 😀

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.