- This topic has 10 replies, 4 voices, and was last updated 15 years ago by Chike.
-
AuthorPosts
-
February 15, 2009 at 7:29 am #187441AdminAdministrator
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 lolFebruary 15, 2009 at 11:56 am #187451ChikeMemberTry
Me.RichTextBox1.Font = New Font(Me.RichTextBox1.Font.FontFamily, 8, Me.RichTextBox1.Font.Style)
February 15, 2009 at 6:27 pm #187450AdminAdministratorthanks but the same thign happens, when i change fonts from one size to the other i takes the others styles away 🙄
February 15, 2009 at 10:04 pm #187449ChikeMemberI 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.February 17, 2009 at 2:04 am #187448AdminAdministratorHow chike 🙂 and here how its looking so far, I even added the color fader
February 17, 2009 at 9:07 am #187447ChikeMember@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?February 17, 2009 at 5:25 pm #187446AdminAdministratorIs 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.
February 19, 2009 at 6:46 am #187445autopilotMemberif 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)February 19, 2009 at 10:17 am #187444ChikeMemberIn 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 +/-.
February 19, 2009 at 3:27 pm #187443AdminAdministratorWTF, 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 🙂
March 7, 2009 at 2:33 am #187442wazzzupMemberyeah good job Admin… 😀
-
AuthorPosts
Related
- You must be logged in to reply to this topic.