vb.net如何在form1中显示文字?
发布网友
发布时间:2024-10-19 14:59
我来回答
共3个回答
热心网友
时间:2024-11-14 19:23
完善下上边仁兄的!!!
Public Class Form1
'注意下边的事件是Paint,而不是Load!!
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim A As String = "文字"
Dim B As Font
B = New Font("simson", 30, FontStyle.Regular, GraphicsUnit.Document)
Me.CreateGraphics.DrawString(A, B, Brushes.Black, 20, 20)
End Sub
End Class
热心网友
时间:2024-11-14 19:23
Dim a$ = "文字"
Me.CreateGraphics.DrawString(a$, New Font("simson", 30, FontStyle.Regular, GraphicsUnit.Document), Brushes.Blue, 20, 20)
该语句将在窗体的 20,20 位置打印“文字”二字,蓝色
热心网友
时间:2024-11-14 19:23
选择一个label控件到form1中,在label属性text中写入就可以了