Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Label font size changing

Tags:

vb.net

label

So I am making a small game in visual basics and at one of the thing I need to do is change the label size following an If statement. Sadly, It seemed way more complicated than I expected... I tried the following but it is "Read only"

If condition = false then
      lbltmp.Font.Size = 12pts
end if    

I also Tried the following based on my friends advise:

With lbltmp.font
.size = 12
end with

I found similar question but they were all in c#, Which I don't know how to code in yet

like image 372
Delupara Avatar asked Dec 30 '25 05:12

Delupara


1 Answers

You need to change font instead of its size ;) See this: LINQ Cookbook, Recipe 1: Change the font for all labels on a windows form (Kit George)

label.Font = New Font("Comic Sans MS", 12, _
                    FontStyle.Bold Or FontStyle.Underline)
like image 73
Maciej Los Avatar answered Dec 31 '25 18:12

Maciej Los



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!