Visual Basic

Hallo leute ,

Heute will ich mit euch über ein program sprechen Namens :

Visual Basic

Also erstmal sag ich euch was man damit macht
Man kann damit gute sachen erstellen zb :

Spiele , Stoppuhr , Rechner , Editor , Paint , Und mehr ……..

Ich gebe euch heute einpaar tipps und codes :

Also … fangen wir mal an !

1.Stoppuhr

code :

Dim a As String
Dim b As String
Dim c As String
Dim x As String
Dim y As String
Dim z As String
Dim h As String
Dim m As String
Dim s As String
Dim u As String
Dim v As String
Public interval As DoublePrivate Sub clock_Click()
Timer1.Enabled = False
Timer2.Enabled = True
End Sub

Private Sub Command1_Click()

Timer1.Enabled = True
Timer1.interval = 1

End Sub

Private Sub Command2_Click()
Timer1.Enabled = False
End Sub

Private Sub Command3_Click()
Timer1.Enabled = False
a = „0“
b = „0“
c = „0“
x = „0“
y = „0“
z = „0“
u = „0“
v = „0“

h = a + b
m = c + x
s = y + z
‚To set the display as „00:00:00.00“
Label1.Caption = h + „:“ + m + „:“ + s + „.“ + u + v
End Sub

Sub counttime()
If Val(v) < 9 Then
v = v + 1

Label1.Caption = a + b + „:“ + c + x + „:“ + y + z + „.“ + u + v
ElseIf Val(u) < 9 Then
v = 0
u = u + 1

Label1.Caption = a + b + „:“ + c + x + „:“ + y + z + „.“ + u + v
ElseIf Val(z) < 9 Then
v = 0
u = 0

z = z + 1

Label1.Caption = a + b + „:“ + c + x + „:“ + y + z + „.“ + u + v
ElseIf Val(y) < 5 Then
v = 0
u = 0
z = 0
y = y + 1
Label1.Caption = a + b + „:“ + c + x + „:“ + y + z + „.“ + u + v
ElseIf Val(x) < 9 Then
v = 0
u = 0
z = 0
y = 0
x = x + 1
Label1.Caption = a + b + „:“ + c + x + „:“ + y + z + „.“ + u + v
ElseIf Val(c) < 5 Then
v = 0
u = 0
z = 0
y = 0
x = 0
c = c + 1
Label1.Caption = a + b + „:“ + c + x + „:“ + y + z + „.“ + u + v
ElseIf Val(b) < 9 Then
v = 0
u = 0
z = 0
y = 0
x = 0
c = 0
b = b + 1
Label1.Caption = a + b + „:“ + c + x + „:“ + y + z + „.“ + u + v
ElseIf Val(b) < 9 Then
v = 0
u = 0
z = 0
y = 0
x = 0
c = 0
b = b + 1
Label1.Caption = a + b + „:“ + c + x + „:“ + y + z + „.“ + u + v
ElseIf Val(a) < 9 Then
v = 0
u = 0
z = 0
y = 0
x = 0
c = 0
b = 0
a = a + 1
Label1.Caption = a + b + „:“ + c + x + „:“ + y + z + „.“ + u + v

End If

End Sub

Private Sub dat_Click()
Label1.Caption = Date
Timer2.Enabled = False
End Sub

Private Sub Form_Load()
a = „0“
b = „0“
c = „0“
x = „0“
y = „0“
z = „0“
u = 0
v = 0
h = a + b
m = c + x
s = y + z
‚To set the display as „00:00:00.00“
Label1.Caption = h + „:“ + m + „:“ + s + „.“ + u + v

End Sub

Private Sub stopwc_Click()
Timer2.Enabled = False
a = „0“
b = „0“
c = „0“
x = „0“
y = „0“
z = „0“
u = „0“
v = „0“

h = a + b
m = c + x
s = y + z
Label1.Caption = h + „:“ + m + „:“ + s + „.“ + u + v

End Sub

Private Sub Timer1_Timer()
counttime

End Sub

Private Sub Timer2_Timer()
Label1.Caption = Time
End Sub

2.Rechner

code :

Private Sub Combo1_()Select Case Combo1.ListIndex
Case 0
Label1 = Str$(Val(Text1.Text) + Val(Text2.Text))
Case 1
Label1 = Str$(Val(Text1.Text) – Val(Text2.Text))
End Select
End Sub

Private Sub Command1_Click()
Select Case Combo1.ListIndex
Case 0
Label1 = Str$(Val(Text1.Text) + Val(Text2.Text))
Case 1
Label1 = Str$(Val(Text1.Text) – Val(Text2.Text))
Case 2
Label1 = Str$(Val(Text1.Text) * Val(Text2.Text))
Case 3
Label1 = Str$(Val(Text1.Text) / Val(Text2.Text))

End Select
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Form_Load()
Combo1.AddItem „+“
Combo1.AddItem „-“
Combo1.AddItem „x“
Combo1.AddItem „÷“
Combo1.ListIndex = 1

End Sub

3.Tic Tac Toe ( spieler V.S Spieler )

code :

Dim cross(8) As Boolean
Dim ball(8) As Boolean
Dim m As Integer
Dim player As Integer


Sub check_status()
If ball(0) = True And ball(1) = True And ball(2) = True Then
Line10.Visible = True
End If
If ball(3) = True And ball(4) = True And ball(5) = True Then
Line9.Visible = True
End If
If ball(6) = True And ball(7) = True And ball(8) = True Then
Line8.Visible = True
End If
If ball(0) = True And ball(3) = True And ball(6) = True Then
Line5.Visible = True
End IfIf ball(1) = True And ball(4) = True And ball(7) = True Then
Line6.Visible = True
End If
If ball(2) = True And ball(5) = True And ball(8) = True Then
Line7.Visible = True
End If
If ball(0) = True And ball(4) = True And ball(8) = True Then
Line12.Visible = True
End If
If ball(2) = True And ball(4) = True And ball(6) = True Then
Line11.Visible = True
End If

If cross(0) = True And cross(1) = True And cross(2) = True Then
Line10.Visible = True
End If
If cross(3) = True And cross(4) = True And cross(5) = True Then
Line9.Visible = True
End If
If cross(6) = True And cross(7) = True And cross(8) = True Then
Line8.Visible = True
End If
If cross(0) = True And cross(3) = True And cross(6) = True Then
Line5.Visible = True
End If

If cross(1) = True And cross(4) = True And cross(7) = True Then
Line6.Visible = True
End If
If cross(2) = True And cross(5) = True And cross(8) = True Then
Line7.Visible = True
End If
If cross(0) = True And cross(4) = True And cross(8) = True Then
Line12.Visible = True
End If
If cross(2) = True And cross(4) = True And cross(6) = True Then
Line11.Visible = True
End If
End Sub


Sub check_position()For m = 0 To 8

If Image1(m).Picture = Image2.Picture Then
ball(m) = True

Else: ball(m) = False
End If

If Image1(m).Picture = Image3.Picture Then
cross(m) = True
Else

cross(m) = False

End If
Next

End Sub

Private Sub Image1_Click(Index As Integer)
check_position

If player = 1 And cross(Index) = False And ball(Index) = False Then
Image1(Index).Picture = Image2.Picture
End If
If player = 2 And cross(Index) = False And ball(Index) = False Then
Image1(Index).Picture = Image3.Picture
End If

check_position
check_status

End Sub

Private Sub Image2_Click()
player = 1
End Sub

Private Sub Image3_Click()
player = 2
End Sub

Private Sub mnuNew_Click()
For m = 0 To 8
Image1(m).Picture = LoadPicture(„“)
Next
Line5.Visible = False
Line6.Visible = False
Line7.Visible = False
Line8.Visible = False
Line9.Visible = False
Line10.Visible = False
Line11.Visible = False
Line12.Visible = False
End Sub

Wenn ihr noch was wollt schreibt ein kommentar ;)Das wars für heute

Bis Morgen

5 Antworten

  1. sorry fürs header aber ich änder ihn in kürzeste zeit

  2. cooler blog player mach weiter so

  3. das ist der tollster blog den ich je gesehen hab 😉

Hinterlasse einen Kommentar