• Log in or sign up for an account here: https://www.sythe.org/login

Help with Fonts

tomanderson12

Member
Joined
Jan 21, 2008
Sythe Gold
0
Messages
53
Hello, as some of you will know a while ago i made a Notepad it was fairly basic well I was bored today so i made a new one and moved things around, Then i decided i wanted to add a way to change the font.

Its a RichtextBox rather than the normal Textbox But im completely stumped on starting this

Any help will be appreciated.
 
Ok, if you are using vb6 it would lok something like this...

Code:
 Text1.Font = calibri

All you need it the text box name, a .font after the name, and then the name of the font exactly like it is spelled in the font selection section.
 
Valentine's Singing Competition Winner
Sythe Awards 2015 Winner
Sythe Awards 2016 Winner
Sythe Awards 2020 Winner
Member of the Month Winner
MushyMuncher
Gohan has AIDS
Extreme Homosex
World War 3
I'm LAAAAAAAME
Discord Verified
Off Topic Participant
I don't have access to VB right now, but I'm almost 100% sure that you can use the Common Dialog control to open up the font dialog so the user can use all the fonts installed on their machine.

Something like...

Code:
CommonDialog1.Font
or something like
CommonDialog1.FontDialog

If you want me to elaborate on this a little more tell me.
 
Blupig is jus that little bit off, but since he doesn't have access to vb, we can cut him some slack :P

This is prob something that you would use for common dialog's and selecting fonts:

Code:
With CommonDialog1 'open the with dialog
.DialogTitle = "Font" 'set the dialog title
.Flags = cdlCFBoth Or cdlCFEffects 'set the flags so you can
'access the fonts* and the strikethru, underline, color

.ShowFont 'show the dialog

You can then use the information above to change the font in the Rich Text Box [RTB1]:

Code:
RTB1.SelFontName = CommonDialog1.FontName 'set the selected font’s name
RTB1.SelFontSize = CommonDialog1.FontSize 'set the selected font’s size
RTB1.SelBold = CommonDialog1.FontBold 'set the selected font’s bold property
RTB1.SelItalic = CommonDialog1.FontItalic 'set the selected font’s italic property
RTB1.SelStrikeThru = CommonDialog1.FontStrikethru 'set the selected font’s strikethrough property
RTB1.SelUnderline = CommonDialog1.FontUnderline 'set the selected font’s underline property

Hope that helped you mate :)
 
Runescape Gamblingrunescape gambling
Back
Top