Visual Basic NET ( 3)


         


End Sub
: MouseDown . e.Clicks 1, , 1. MouseDown e.Clicks 2. 2, .
112.
Dim dx, dy As Integer
Dim As Integer = 1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PictureBox1.Left = PictureBox1.Left + dx ' PictureBox
PictureBox1.Top = PictureBox1.Top + dy
End Sub
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown
Select Case e.KeyCode
Case Keys.Left : dx = - : dy = 0
Case Keys.Right : dx = : dy = 0
Case Keys.Up : dx = 0 : dy = -
Case Keys.Down : dx = 0 : dy =
End Select
End Sub
113.
Dim As Char
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles MyBase.KeyPress
= Char.ToUpper(e.KeyChar) '
Me.Refresh() '
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles MyBase.Paint
Dim As Graphics = Me.CreateGraphics
.DrawRectangle(Pens.Black, 20, 20, 100, 300) '
Select Case
Case "R"
.FillEllipse(Brushes.Red, 30, 30, 80, 80) '_
.FillEllipse(Brushes.Black, 30, 130, 80, 80) '_

    





Forekc.ru
, , , , , , , , , ,