So ich hab mir mal überlegt, da ich ja seit einer weile mit Visual Basic Programmiere, meine erste Anleitung zu schreiben. Bei diesem Programm handelt es sich darum, das lauter 0en und 1en von oben nach unten fliegen.
Na dann will ich mal mit der Anleitung beginnen.
Wie erstelle ich ein Matrix-Code im Binär-System??
----
1. Folgende Dinge müsst ihr vorher erstellen:
- 9 Textfelder (Position und größe völlig egal)
- 1 Timer (Position völlig egal. Kein Interval einstellen!)
----->Objekte nicht Umbennen!<-----
2. Folgende Dinge müsst ihr nun voreinstellen:
Textfelder:
--> MultiLine = True
--> BorderStyle = 0
Dialog
--> BorderStyle = 1 (nicht unbedingt notwendig, aber schöner)
3. Kopiert folgenden Code:
Private Sub Form_Load()
Form1.Height = "3720" 'Höhe des Dialoges
Form1.Width = "2160" 'Breite des Dialoges
Form1.ScaleHeight = 3210 'Anzahl der Einheiten der vertikalen Abmessung im Inneren des Dialoges
Form1.BackColor = &H0& 'Farbe des Dialoges
Form1.ScaleWidth = "2040" 'Anzahl der Einheiten der horizontalen Abmessung im Inneren des Dialoges
Timer1.Interval = "50" 'Intervalgeschwindigkeit des Timers
Text1.Top = "0" 'Ausrichtung des Textfeldes nach oben (hier: ganz am oberen Rand des Dialoges)
Text2.Top = "0"
Text3.Top = "0"
Text4.Top = "0"
Text5.Top = "0"
Text6.Top = "0"
Text7.Top = "0"
Text8.Top = "0"
Text9.Top = "0"
Text1.Text = "0" 'Inhalt des Textfeldes
Text2.Text = "0"
Text3.Text = "0"
Text4.Text = "0"
Text5.Text = "0"
Text6.Text = "0"
Text7.Text = "0"
Text8.Text = "0"
Text9.Text = "0"
Text1.Height = "3150" 'Höhe des Textfeldes
Text2.Height = "3150"
Text3.Height = "3150"
Text4.Height = "3150"
Text5.Height = "3150"
Text6.Height = "3150"
Text7.Height = "3150"
Text8.Height = "3150"
Text9.Height = "3150"
Text1.Width = "135" 'Breite des Textfeldes
Text2.Width = "135"
Text3.Width = "135"
Text4.Width = "135"
Text5.Width = "135"
Text6.Width = "135"
Text7.Width = "135"
Text8.Width = "135"
Text9.Width = "135"
Text1.Left = "0" 'Ausrichtung des Textfeldes nach Links
Text2.Left = "240"
Text3.Left = "480"
Text4.Left = "720"
Text5.Left = "960"
Text6.Left = "1200"
Text7.Left = "1440"
Text8.Left = "1680"
Text9.Left = "1920"
Text1.BackColor = &H0& 'Hintergrundfarbe des Textfeldes
Text2.BackColor = &H0&
Text3.BackColor = &H0&
Text4.BackColor = &H0&
Text5.BackColor = &H0&
Text6.BackColor = &H0&
Text7.BackColor = &H0&
Text8.BackColor = &H0&
Text9.BackColor = &H0&
Text1.ForeColor = &HC000& 'Schriftfarbe des Textfeldes
Text2.ForeColor = &HC000&
Text3.ForeColor = &HC000&
Text4.ForeColor = &HC000&
Text5.ForeColor = &HC000&
Text6.ForeColor = &HC000&
Text7.ForeColor = &HC000&
Text8.ForeColor = &HC000&
Text9.ForeColor = &HC000&
End Sub
Private Sub Timer1_Timer()
Text1.Text = Int((Rnd * Rnd) + Rnd) & Text1
Text2.Text = Int((Rnd * Rnd) + Rnd) & Text2
Text3.Text = Int((Rnd * Rnd) + Rnd) & Text3
Text4.Text = Int((Rnd * Rnd) + Rnd) & Text4
Text5.Text = Int((Rnd * Rnd) + Rnd) & Text5
Text6.Text = Int((Rnd * Rnd) + Rnd) & Text6
Text7.Text = Int((Rnd * Rnd) + Rnd) & Text7
Text8.Text = Int((Rnd * Rnd) + Rnd) & Text8
Text9.Text = Int((Rnd * Rnd) + Rnd) & Text9
End Sub
4. Schließt das Code-Fenster und startet das Programm.
----------------
Ich habe noch eine Datei angehangen, wo der Code nochmal genau drinsteht. Auserdem ist auch ein Beispiel dabei, wie das Programm dann am Ende aussehen wird.


Reply With Quote