Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing font

Status
Not open for further replies.

baha

Programmer
Apr 16, 2002
28
0
0
US
Hi,

Please help me with the font changing. In my program i have to make the font and collor of a text to change.

I have a main form frmMain, and i have a label there lblText, i have menu commands: Edit and Font,Color.
When i press Font menu command i should be able to choose different fonts (timesnewroman etc.)

What i did is i created another form, which has a label "Enter the Font" and a list box with TimesNewRoman, Arial and etc, and cmdOK.When i click on menu command "font"
on the main form this form appears and allows to choose a font from a list, after it should disappear.
Here is my code:
Private cmdOK_Click()
If lbxFont.ListIndex = "Arial" Then _ frmMain.lblText.FontName = Arial
Unload frmFont
EndSub

It says variable is not defined and Highlights Arial.

Maybe u can suggest something or there are some other ways

Thanks.
 
You might want to try putting Arial is Quotes.

frmMain.lblText.FontName = "Arial" Good Luck
------------
Select * from Users where Clue > 0
0 rows returned
 
I tried to put in quotes, but now it shows type mismatch and highlits --If lbxFont.ListIndex = "Arial" Then --

any other methods of doing that ?

Thanks
 
I think i found an answer,

I put: lbxFont.ListIndex = "1" Then -- instead of lbxFont.ListIndex = "Arial" Then --, so the "Arial" is equal "1".


It worked so far, i will try to put some more fonts.

Thanks, i hope that is the way it should be.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top