新网创想网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
新建窗体,把maximizebox属性和MinimizeBox 属性设为false,再添加一个Label1放置文字一个Picturebox1放图片。
专注于为中小企业提供网站建设、成都网站建设服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业银海免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了上千企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。
在窗体的load事件中:
Private Sub Form1_Load() Handles Me.Load
Text="我的VB.NET程序"
PuctureBox1.Image=Image.FromFile(图片路径如e:\pic.jpg)
End Sub
窗体Click事件:
Private Sub Form1_Click() Handles Me.Click
Text="单击窗体"
Label1.Text="欢迎使用VB.NET"
End Sub
窗体DoubleClick事件
Private Sub Form1_DoubleClick() Handles Me.DoubleClick
Text="双击窗体"
Label1.Text = "谢谢使用!"
End Sub
写的比较粗糙,参考一下吧
Sub Main()
Dim numArr() As Double
Dim count As Integer = 1
Dim num As Double
Dim sumNum As Double = 0
Dim aveNum As Double
Dim flag As Integer = 0
While (True)
Console.Write("请输入第{0}个数:", count)
ReDim Preserve numArr(count - 1)
num = Convert.ToDouble(Console.ReadLine())
If num = 0 Then
Exit While
End If
numArr(count - 1) = num
count += 1
End While
If count 1 Then
Dim cha As Double
Dim minCha As Double = Double.MaxValue
For i As Integer = 0 To count - 1
sumNum += numArr(i)
Next
aveNum = sumNum / (count - 1)
For i As Integer = 0 To count - 1
cha = Math.Abs(aveNum - numArr(i))
If minCha = cha Then
minCha = cha
flag = i + 1
End If
Next
End If
Console.WriteLine("总共输入{0}个正数,平均值为{1}", count - 1, aveNum)
Console.WriteLine("最接近平均值的是第{0}个正数,值为{1}", flag, numArr(flag - 1))
Console.ReadKey()
End Sub
设置Region属性:DimpathAsNewSystem.Drawing.Drawing2D.GraphicsPathpath.AddEllipse(0,0,400,300)Region=NewRegion(path)