отображать изображение в C #

Я хочу отображать изображения с помощью C # с помощью PictureBox . Я создал класс, содержащий pictureBox и таймер. но при создании объекта из этого ничего не отображается.

что мне делать?

правильно ли я использую timer1?

Вот мой код:

    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        c1 c = new c1();
        c.create_move(1);
    }

}

class c1 {

    PictureBox p = new PictureBox();
    Timer timer1 = new Timer();

    public void create_move(int i){

        p.ImageLocation = "1.png";
        p.Location = new Point(50, 50 + (i - 1) * 50);

        timer1.Start();
        timer1.Interval = 15;
        timer1.Tick += new EventHandler(timer_Tick);
    }


    private int k = 0;
    void timer_Tick(object sender, EventArgs e)
    {
         // some code. this part work outside the class c1 properly.
         ...

    }
16
задан Joe White 2 February 2011 в 13:12
поделиться