Results 1 to 3 of 3

Thread: [RESOLVED] Redrawing chart when application is activated?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Stockholm, Sweden
    Posts
    316

    Resolved [RESOLVED] Redrawing chart when application is activated?

    Hi,

    I´m drawing my own charts based on values from a db. I´m drawing "directly" on the forms, so to speak.

    The thing is everytime the application is deactivated or if someting comes in front of the charts, the drawing dissappears. For instance, I have a contextmenu in one chart and whenever I use it there is a "hole" in the chart afterwards where the menu has been.

    Now I can see the reason for it, but how do I get around it?

    Fuga.
    Visual Studio 2010 xpress, Visual Studio 2008 pro, SQL Server, SQL Server management studio 2008 r2, MSAccess

  2. #2
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: Redrawing chart when application is activated?

    On Form.Activated or Form.Visible or similar event try to call
    Me.Invalidate()
    1. If this post helped you, please Rate it = That's You, saying Thanks, to Me ...Left side of this post: [Rate this post]
    2. Mark this Thread Resolved if your question has been answered That's You, saying Thanks, to Group ...Menu on top of your original Post: [Thread Tools]>[Mark Thread Resolved]
    3.
    Check my site: www.er-ef.netCheck my snippets: Get installed .NET versionsRegex extractingJoin hierarchically nested Datatables in one flattened Datatable


  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Redrawing chart when application is activated?

    Any drawing should be done in the Paint event of the control. If you move your drawing code to the form.Paint event handler, it will fix itself.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

Posting Permissions

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



Click Here to Expand Forum to Full Width