Click here to Skip to main content
15,894,540 members
Home / Discussions / C#
   

C#

 
QuestionMessage Removed Pin
15-Jun-10 8:22
professionalsafame2015-Jun-10 8:22 
AnswerRe: I am having some Problems in Implementing Threads for Listview PinPopular
Luc Pattyn15-Jun-10 8:54
sitebuilderLuc Pattyn15-Jun-10 8:54 
QuestionMesauring paint on a winforms panel Pin
Berlus15-Jun-10 7:18
Berlus15-Jun-10 7:18 
AnswerRe: Mesauring paint on a winforms panel Pin
Luc Pattyn15-Jun-10 7:57
sitebuilderLuc Pattyn15-Jun-10 7:57 
GeneralRe: Mesauring paint on a winforms panel Pin
Berlus15-Jun-10 10:57
Berlus15-Jun-10 10:57 
GeneralRe: Mesauring paint on a winforms panel Pin
Luc Pattyn15-Jun-10 11:22
sitebuilderLuc Pattyn15-Jun-10 11:22 
GeneralRe: Mesauring paint on a winforms panel Pin
Berlus15-Jun-10 19:41
Berlus15-Jun-10 19:41 
GeneralRe: Mesauring paint on a winforms panel Pin
Luc Pattyn16-Jun-10 2:00
sitebuilderLuc Pattyn16-Jun-10 2:00 
Hi,

you need to be more accurate when explaining things; you first said Control, then symbol, now drawing; and a pen is not a drawing.

I explained how to do it.

Here is working code:
public void RunTimingTest() {
    Form f=new Form();
    Button btn=new Button();
    btn.Text="Start";
    btn.Click+=new EventHandler(btn_Click);
    btn.Bounds=new Rectangle(20, 20, 200, 40);
    f.Controls.Add(btn);
    lbl=new System.Windows.Forms.Label();
    lbl.Bounds=new Rectangle(20, 80, 400, 30);
    f.Controls.Add(lbl);
    p=new MyPanel();
    p.Bounds=new Rectangle(20, 150, 200, 100);
    p.BackColor=Color.Yellow;
    f.Controls.Add(p);
    f.Show();
}

void btn_Click(object sender, EventArgs e) {
    p.Count=0;
    lbl.Text="";
    Stopwatch sw=new Stopwatch();
    sw.Start();
    int n=100*r.Next(1, 10);
    for (int i=0; i<n; i++) {
        p.Text="MyPanel "+i.ToString();
        p.Refresh();
    }
    sw.Stop();
    lbl.Text="Did "+p.Count+" paints in "+sw.ElapsedMilliseconds+" msec";
}

public class MyPanel : Panel {
    public int Count;
    public string Text;

    protected override void OnPaint(PaintEventArgs e) {
        Count++;
        base.OnPaint(e);
        e.Graphics.DrawString(Text, Font, Brushes.Black, new Point(20, 20));
    }
}


The spoon feeding ends here.

Hmmm | :|
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Nil Volentibus Arduum

GeneralRe: Mesauring paint on a winforms panel Pin
Berlus16-Jun-10 10:02
Berlus16-Jun-10 10:02 
GeneralRe: Mesauring paint on a winforms panel Pin
Luc Pattyn16-Jun-10 10:12
sitebuilderLuc Pattyn16-Jun-10 10:12 
Questionstring matching Pin
arkiboys15-Jun-10 6:56
arkiboys15-Jun-10 6:56 
AnswerRe: string matching Pin
Ravi Bhavnani15-Jun-10 7:00
professionalRavi Bhavnani15-Jun-10 7:00 
AnswerRe: string matching [modified] Pin
Luc Pattyn15-Jun-10 7:05
sitebuilderLuc Pattyn15-Jun-10 7:05 
AnswerRe: string matching Pin
Dave Kreskowiak15-Jun-10 7:08
mveDave Kreskowiak15-Jun-10 7:08 
GeneralRe: string matching Pin
Luc Pattyn15-Jun-10 7:13
sitebuilderLuc Pattyn15-Jun-10 7:13 
GeneralRe: string matching Pin
arkiboys15-Jun-10 7:59
arkiboys15-Jun-10 7:59 
AnswerRe: string matching Pin
T M Gray15-Jun-10 8:34
T M Gray15-Jun-10 8:34 
GeneralRe: string matching Pin
arkiboys15-Jun-10 8:46
arkiboys15-Jun-10 8:46 
GeneralRe: string matching Pin
Luc Pattyn15-Jun-10 11:36
sitebuilderLuc Pattyn15-Jun-10 11:36 
GeneralRe: string matching Pin
arkiboys15-Jun-10 11:38
arkiboys15-Jun-10 11:38 
GeneralRe: string matching Pin
Luc Pattyn15-Jun-10 11:38
sitebuilderLuc Pattyn15-Jun-10 11:38 
QuestionSystem.IO.Exception Pin
MWRivera15-Jun-10 6:32
MWRivera15-Jun-10 6:32 
AnswerRe: System.IO.Exception Pin
J4amieC15-Jun-10 6:44
J4amieC15-Jun-10 6:44 
GeneralRe: System.IO.Exception Pin
MWRivera15-Jun-10 7:45
MWRivera15-Jun-10 7:45 
AnswerRe: System.IO.Exception Pin
Luc Pattyn15-Jun-10 7:10
sitebuilderLuc Pattyn15-Jun-10 7:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.