Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Video URL: https://www.youtube.com/watch?v=CV9hGCDTPdA
- Das muss in den Form Load:
- private void Form1_Load(object sender, EventArgs e)
- {
- timer1.Start();
- timer2.Start();
- }
- Hier der Code für den Lauftext:
- private void timer1_Tick(object sender, EventArgs e)
- {
- lbl_lauf.Location = new Point(lbl_lauf.Location.X + 5, lbl_lauf.Location.Y);
- if (lbl_lauf.Location.X > this.Width)
- {
- lbl_lauf.Location = new Point(0 – lbl_lauf.Width, lbl_lauf.Location.Y);
- }
- }
- Hier der Code für den Blinktext:
- Ihr müsst zusätzlich einen Integer mit dem Farbzustand erstellen. Diesen müsst ihr direkt in die Partial Class erstellen da jede Methode Zugriff auf diesen benötigt. Für das erstellen könnt ihr: int co = 0; verwenden
- private void timer2_Tick(object sender, EventArgs e)
- {
- if (co == 0)
- {
- lbl_blink.ForeColor = Color.Blue;
- co = 1;
- }
- else
- {
- lbl_blink.ForeColor = Color.Red;
- co = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement