Jump to content


Photo

Visual Studio 2008 C# - program


  • Please log in to reply
2 replies to this topic

#1 Dziunia

Dziunia
  • Użytkownicy
  • 2 posts

Posted 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
  • 0


#2 shower

shower
  • Użytkownicy
  • 35 posts

Posted 15 maj 2011 - 19:02

wystarczy dwukrotnie przycisnac na interesujacy cie button i Cie przenosi do edycji kodu ktora dotyczy danego buttona
  • 0
Alea iacta est

#3 Dziunia

Dziunia
  • Użytkownicy
  • 2 posts

Posted 15 maj 2011 - 19:08

ok. a co dalej?
ten kod ma się znaleźć w buttonie
  • 0


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users