Click here to Skip to main content
16,023,339 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends

In load event i loaded sizes with help of i As:

VB
Dim i As Long
For i = 1 To 24 Step 2
   cbofontsize.Items.Add(i)
Next

Then on Button click event i used:
VB
Buttons(i).Font.Size = cbofontsize.SelectedItem


But the above way i am getting error as property size read only.
Where i want it to be on button text.

Any help on how t retrieve font sizes with help of font family event or so would be really appreciated.
Posted
Updated 29-Nov-10 18:21pm
v3

1 solution

Hi,

Please use following:

VB
Dim myFont As System.Drawing.Font
myFont = New System.Drawing.Font("Arial", cbofontsize.SelectedItem,FontStyle.Bold)
Buttons(i).Font = myFont



Please do let me know, if you have any doubt.

Please provide "Vote":thumbsup: if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose:

Thanks,
Imdadhusen
 
Share this answer
 
Comments
parchuri08 30-Nov-10 3:20am    
firstly thanx for providing answer. the code you provided could not retreive font sizes into combobox -cbofontsize and it was not applicable for text on button.

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