Generally, hello. In the C # project I want to make a running / blinking line on the form, is it possible? If yes, then help a very new beginner in C # ... I would be very grateful! :)

    1 answer 1

    Quickly sketched:

    private void Form1_Load(object sender, EventArgs e) { start = label1.ForeColor; end = Color.White; Timer timer = new Timer(); timer.Interval = 500; timer.Tick += timer_Tick; timer.Start(); } Color start; Color end; void timer_Tick(object sender, EventArgs e) { if (label1.ForeColor == start) label1.ForeColor = end; else label1.ForeColor = start; if (label1.Left > -label1.Width) label1.Left -= 5; else label1.Left = this.Width;//this - относительно чего label будет двигаться влево } 
    • I'm really dumb, right? : with data2.floomby.com/files/share/3_8_2013/… - bAcup
    • one
      Fix to: private void Form1_Load (object sender, EventArgs e) {System.Media.SoundPlayer Audio; Audio = new System.Media.SoundPlayer (Properties.Resources.cherry2); Audio.Load (); Audio.PlayLooping (); start = label1.ForeColor; end = Color.White; Timer timer = new Timer (); timer.Interval = 500; timer.Tick + = timer_Tick; timer.Start (); } - GenkaOk
    • 2
      @bAcup: To be honest, you would first learn the basic syntax of the language, and then complain that you wrote the correct answer, but did not insert it into your program. Shame on you. - VladD
    • one
      I'm ashamed. I will do as you said. I'm sorry. - bAcup