VB 2008 Funtext The Begining :)

You can talk about VB programming here

VB 2008 Funtext The Begining :)

Postby locohacker » Sun Feb 15, 2009 2:29 am


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
Code: Select all
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 :roll:
here what I got so far, its just the begining lol
Attachments
Funtextvbsc2008.rar
(128.86 KiB) Downloaded 161 times
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Re: VB 2008 Funtext The Begining :)

Postby Chike » Sun Feb 15, 2009 6:56 am

Try
Code: Select all
Me.RichTextBox1.Font = New Font(Me.RichTextBox1.Font.FontFamily, 8, Me.RichTextBox1.Font.Style)
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: VB 2008 Funtext The Begining :)

Postby locohacker » Sun Feb 15, 2009 1:27 pm

thanks but the same thign happens, when i change fonts from one size to the other i takes the others styles away :roll:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Re: VB 2008 Funtext The Begining :)

Postby Chike » Sun Feb 15, 2009 5:04 pm

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.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: VB 2008 Funtext The Begining :)

Postby locohacker » Mon Feb 16, 2009 9:04 pm

How chike :) and here how its looking so far, I even added the color fader :mrgreen:
Attachments
ft2008.gif
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Re: VB 2008 Funtext The Begining :)

Postby Chike » Tue Feb 17, 2009 4:07 am

locohacker 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?
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: VB 2008 Funtext The Begining :)

Postby locohacker » Tue Feb 17, 2009 12:25 pm

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.
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Re: VB 2008 Funtext The Begining :)

Postby autopilot » Thu Feb 19, 2009 1:46 am

if i understand what you want to do, you want to use .SelectionFont like this example
Code: Select all
        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
Code: Select all
        Dim myStyle As FontStyle
        myStyle = FontStyle.Bold + FontStyle.Italic
        Me.RichTextBox1.SelectionFont = New Font("Arial", 8, myStyle)
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Re: VB 2008 Funtext The Begining :)

Postby Chike » Thu Feb 19, 2009 5:17 am

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 +/-.
Image
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Re: VB 2008 Funtext The Begining :)

Postby locohacker » Thu Feb 19, 2009 10:27 am

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 :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4364
Joined: Fri Dec 31, 2004 6:59 pm

Re: VB 2008 Funtext The Begining :)

Postby wazzzup » Fri Mar 06, 2009 9:33 pm

yeah good job locohacker... :D
User avatar
wazzzup
imFiles Senior
imFiles Senior
 
Posts: 119
Joined: Fri Feb 02, 2007 8:17 pm
Location: none


Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests