大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
你可以在窗体上放一个lable控件,取名叫lable1,
为岷县等地区用户提供了全套网页设计制作服务,及岷县网站建设行业解决方案。主营业务为网站设计制作、做网站、岷县网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!
那么实现方式就是:
private
sub
form_load()
lable1.text="今天天气很好";
end
sub
你可以试试
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim nBrush As New SolidBrush(Color.Red)
Dim font As New Font("宋体", 12)
Dim bmp As Bitmap = Bitmap.FromFile("c:\123.jpg")
Dim info As String = "完成"
Dim g As Graphics = Graphics.FromImage(bmp)
Dim sizef As SizeF = g.MeasureString(info, font)
Dim left As Single = (PictureBox1.Width - sizef.Width) / 2
Dim top As Single = (PictureBox1.Height - sizef.Height) / 2
g.DrawString(info, font, nBrush, left, top)
g = PictureBox1.CreateGraphics
g.DrawImage(bmp, 0, 0)
g = Nothing
bmp = Nothing
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim font As New Font("宋体", 16)
Dim g = PictureBox1.CreateGraphics
Dim str As String = "a001"
Dim x As Integer = (PictureBox1.Size.Width - g.MeasureString(str, font).Width) / 2 '文字居中
Dim y As Integer = 0
Dim nBrush As New SolidBrush(Color.Turquoise)
g.FillRectangle(nBrush, 0, 0, PictureBox1.Size.Width, g.MeasureString(str, font).Height)
nBrush = New SolidBrush(Color.Red)
g.DrawString(str, font, nBrush, x, y)
g = Nothing
End Sub