资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

vb.net设置文本字号,vb中设置字体的代码

vb.net中,如何用代码设置字体及字号?不要谈对话框的那种

"Me.RichTextBox1.SelectionFont

站在用户的角度思考问题,与客户深入沟通,找到南山网站设计与南山网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:成都网站设计、网站建设、企业官网、英文网站、手机端网站、网站推广、域名注册、网络空间、企业邮箱。业务覆盖南山地区。

=

New

Font("宋体",

14.25!,

FontStyle.Bold

Or

FontStyle.Italic)"

VB.net中如何在代码中设置文本框字体的大小

Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged

Dim a As FontStyle

a = Me.TextBox1.Font.Size

Dim b As Single = a * 10

Me.TextBox1.Width = Me.TextBox1.Width * 10

Me.TextBox1.Font = New System.Drawing.Font("PMingLiU ", b, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(136, Byte)) '放大10倍,若仅10号字体,则将b改为10

End Sub

vb.net 代码调整字体大小

看样要重新定义个Font对象,在构造函数中定义它的大小,

With Button1.Font

Button1.Font = New Font(.FontFamily, 34, .Style, .Unit) '参数都用原来字体参数,只有大小改成你需要的。

End With

VB怎么用代码设置字体字号还有字体颜色

在VB6中可以通过设置对象的Font属性设置字体字号,ForeColor属性设置字体颜色。

例如,下面代码实现设置文本框中的字体为”隶书“字号28磅,字体颜色为红色

Private Sub Command1_Click()

Text1.Font.Size = 28

Text1.Font.Name = "隶书"

Text1.ForeColor = vbRed

End Sub

vb.net如何设置FORM的text字体

您好。修改FORM的Font属性就可以修改窗体和其中所有控件的字体。

Me.Font = New System.Drawing.Font("宋体", 10)

另外,FORM标题栏的TEXT字体和颜色是操作系统决定的,要想改变,只能调用系统的api函数,截获操作系统的消息来改变。

下面的网址有C#版本的重绘标题栏范例

软糖的回答满意吗,请及时采纳,谢谢。

VB.NET文本框中的文本格式进行相应的设置

太晚了,想不出什么好方法了。

发上来看看吧。

首先建立一个TextBox,我这里名字为TextBox2

然后放一个groupbox,在里头放两个Checkbox,checkbox1为粗体,checkbox2为斜体。

代码:

Dim Bold As Boolean

Dim Italic As Boolean

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

If CheckBox1.Checked Then

Bold = True

If Italic Then

TextBox2.Font = New Font(TextBox2.Font, FontStyle.Bold Or FontStyle.Italic)

Else

TextBox2.Font = New Font(TextBox2.Font, FontStyle.Bold)

End If

Else

Bold = False

If Italic Then

TextBox2.Font = New Font(TextBox2.Font, FontStyle.Italic)

Else

TextBox2.Font = New Font(TextBox2.Font, 0)

End If

End If

End Sub

Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged

If CheckBox2.Checked Then

Italic = True

If Bold Then

TextBox2.Font = New Font(TextBox2.Font, FontStyle.Italic Or FontStyle.Bold)

Else

TextBox2.Font = New Font(TextBox2.Font, FontStyle.Italic)

End If

Else

Italic = False

If Bold Then

TextBox2.Font = New Font(TextBox2.Font, FontStyle.Bold)

Else

TextBox2.Font = New Font(TextBox2.Font, 0)

End If

End If

End Sub

可以等等别人回答,看看有没有更好的方法。


文章标题:vb.net设置文本字号,vb中设置字体的代码
网站路径:http://cdkjz.cn/article/hdhoho.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220