Visual basic [2 урок] - Первая программа на VB.NET
...
Мы сегодня сделать первую программу!
Создаём новый проект или нажимаем (CTRL+N)
Называем: как хотите!
И размещаем на форме: Button1, Button2, Button3, Button4, Button5, Button6, Label1, Label2, Label3, Progressbar1, Trackbar1, Trackbar2, Trackbar3, RectangleShape1, GroupBox1, Textbox1, Textbox2, Timer1.
И вставляем код!
Код
Код:Public Class Form1 Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll ProgressBar1.Value = TrackBar1.Value End Sub Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBar1.Click TrackBar1.Value = ProgressBar1.Value End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Text = TextBox1.Text End Sub Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.Scroll Me.Size = New Size(TrackBar2.Value, TrackBar3.Value) TextBox2.Text = Me.Size.Width & "/" & Me.Size.Height End Sub Private Sub TrackBar3_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar3.Scroll Me.Size = New Size(TrackBar2.Value, TrackBar3.Value) TextBox2.Text = Me.Size.Width & "/" & Me.Size.Height End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ProgressBar1.Value = ProgressBar1.Maximum TrackBar1.Value = ProgressBar1.Maximum System.Threading.Thread.Sleep(1000) ProgressBar1.Value = 0 TrackBar1.Value = 0 Timer1.Stop() End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click MsgBox("Привет! Это я, твой компьютер!") End Sub End Class
Вот исходник!
Download
Теги: Visual,basic,[,],2,урок,-,Первая,программа,на,VB.NET