Skocz do zawartości


Dziunia

Rejestracja: 15 maj 2011
Poza forum Ostatnio: 15 maj 2011 20:44
-----

Moje tematy

Visual Studio 2008 C# - program

15 maj 2011 - 17:25

Witajcie. Mam problem z programem.
Jak przypisać ten fragment kodu:
private void panel1_Paint(object sender, PaintEventArgs e)
        {
            base.OnPaint(e)<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />

            Graphics gfx = e.Graphics;
            Rectangle clip = e.ClipRectangle;

            Pen pen = new Pen(Color.Red, 1)<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />

            foreach (Rectangle r in rects)
            {
                gfx.DrawRectangle(pen, r)<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
            }

            if (pressed)
            {
                Pen pen2 = new Pen(Color.Green)<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />

                gfx.DrawRectangle(pen2, Math.Min(p1.X, p2.X),
                    Math.Min(p1.Y, p2.Y),
                    Math.Max(p1.X, p2.X) - Math.Min(p1.X, p2.X),
                    Math.Max(p1.Y, p2.Y) - Math.Min(p1.Y, p2.Y))<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />

            }
            panel1.Invalidate()<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
        }

do przycisku.
Proszę o pomoc