Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have problem when i set my lable font as 8 and when i click on label than it give font size as 8.5

my code is

lblText.font=new font("Arial",8,0)

and when i click on label then prompt me label size as 8.25
Posted

1 solution

Hi Haresh,

Try setting the fontfamily and font.style like this :

lbltext.Font = New Font(New FontFamily("Arial"), 8.5, FontStyle.Regular)


I hope this could help you,
VG
 
Share this answer
 
Comments
hareshdgr8 11-Mar-13 6:43am    
sir but i want to add label size as 8 then what
_Vitor Garcia_ 11-Mar-13 7:17am    
you said 8.5
If you want it to be 8 then do this :
lbltext.Font = New Font(New FontFamily("Arial"), 8, FontStyle.Regular)

Best regards,
VG
hareshdgr8 11-Mar-13 8:44am    
i tried but when i click on that label it give me msg as font is 8.5 size
_Vitor Garcia_ 11-Mar-13 8:57am    
please provide me the messagebox code.
hareshdgr8 12-Mar-13 1:55am    
my first code is
Label.font=New Font(Segoe, 8, 0)

when i click on my click i give it msgbox like

msgbox(Label.font.size)
it show me 8.5
how its possible

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900