vb.net如何在form1中显示文字?
3个回答
展开全部
完善下上边仁兄的!!!
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
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
展开全部
Dim a$ = "文字"
Me.CreateGraphics.DrawString(a$, New Font("simson", 30, FontStyle.Regular, GraphicsUnit.Document), Brushes.Blue, 20, 20)
该语句将在窗体的 20,20 位置打印“文字”二字,蓝色
Me.CreateGraphics.DrawString(a$, New Font("simson", 30, FontStyle.Regular, GraphicsUnit.Document), Brushes.Blue, 20, 20)
该语句将在窗体的 20,20 位置打印“文字”二字,蓝色
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
选择一个label控件到form1中,在label属性text中写入就可以了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询