CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2002
    Ottawa, Canada

    Delete or updating GDI items

    Pretty simple question here. If you use a gdi+ item to draw some text, how do you go back to it and update it or clear it.

    protected override void OnPaint(PaintEventArgs pe)
    Font fnt = new Font("Verdana", 16);
    Graphics g = pe.Graphics;

    // Main Title Bar
    g.DrawString("SELECT OPERATIONAL MODE", fnt, new SolidBrush(Color.Yellow), 230, 50);


    I don't see any means to remove or update something that was drawn.
    Can someone give some input on my view of this problem and if possible, how to attack it?

  2. #2
    Join Date
    Jun 2008

    Re: Delete or updating GDI items

    You draw it anew each time the method is called. Also, make sure to dispose of your font objects.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)