VB 窗口中label text等控件的字体改变大小
- 提问者网友:故事与他
- 2021-02-03 11:36
- 二级知识专家网友:开心就好
- 2021-02-03 13:15
- 1楼网友:修女的自白
- 2021-02-03 14:17
- 2楼网友:白日梦制造商
- 2021-02-03 13:58
使用for each 遍历窗体所有控件,
如果是label 或 text 控件则改变其字体,或颜色。
以下代码vs2008下通过测试。
e.g.
'---------------------------------------------------
'窗体:form1
'2个label : label1,label2
'2个textbox: textbox1,textbox2
'1个button : button1
'-----------------------------------------------------------
public class form1
'按钮单击时间
private sub button1_click(byval sender as system.object, byval e as system.eventargs) handles button1.click dim ob as control dim obtype as string for each ob in me.controls obtype = ob.gettype().tostring() if obtype = "system.windows.forms.textbox" or obtype = "system.windows.forms.label" then ob.forecolor = color.blue ‘字体颜色 ob.font = new system.drawing.font("宋体", 20.5f, fontstyle.underline) ’字体 end if next end sub end class
• 手机登qq时,显示手机磁盘不足,清理后重新登 |
• 刺客的套装怎么选啊? |