标签字体大小更改 [英] Label font size changing
本文介绍了标签字体大小更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我要用视觉基础做一个小游戏,我要做的一件事是在If语句之后更改标签大小.可悲的是,它似乎比我预期的要复杂得多...我尝试了以下操作,但它是只读的"
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
我发现了类似的问题,但是它们都在c#中,我还不知道如何编写代码
I found similar question but they were all in c#, Which I don't know how to code in yet
推荐答案
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)
这篇关于标签字体大小更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文