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
上面思路是正确的, 用ascw 函数也可以
private function LenC( ps as string ) as Integer
Dim n As Integer
Dim StrLen As Integer
For n = 1 To Len(Text1.Text)
If Ascw(Mid(Text1.Text, n, 1)) 256 Then
StrLen = StrLen + 2
Else
StrLen = StrLen + 1
Next n
return strLen
end function
看样要重新定义个Font对象,在构造函数中定义它的大小,
With Button1.Font
Button1.Font = New Font(.FontFamily, 34, .Style, .Unit) '参数都用原来字体参数,只有大小改成你需要的。
End With
Dim MyGraphics As Graphics = Me.CreateGraphics
'定义使用的字体
Dim Myfont As New Font("宋体", 9)
'获取文本的大小。
Dim Mystring_Size As SizeF = MyGraphics.MeasureString("中", Myfont)
'显示宽和高
MsgBox(Mystring_Size1.Width ":" Mystring_Size1.Height)