U E D R , A S I H C RSS

데블스캠프2012/넷째날/묻지마Csharp/Mission3/김준석


  • Timer를 이용해서 Label을 HTML의 Marquee효과를 내면서 이동시킨다


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TestWindowFormDevils
{
    public partial class Form1 : Form
    {
        int time = 0;
        public Form1()
        {
            InitializeComponent();
        }


        private void pushButton_Click(object sender, EventArgs e)
        {
            if (timer.Enabled == true)
            {
                timer.Stop();
            }
            else timer.Start();
        }

        private void timer_Tick(object sender, EventArgs e)
        {
            time++;
            string str = timerLabel.Text;
            string strSub = str.Substring(1) + str[0];
            timerLabel.Text = strSub;
            label2.Text = time + "";
        }

    


    }
}





Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2012-06-28 15:12:22
Processing time 0.0080 sec