locked
menu leaves blank spot on its dismiss RRS feed

  • Question

  • hello,
    there is not any good google result to my problem;) so i ask here for help;

    i am drawing some text and images 'on the fly'
    e.Graphics.DrawImage(drawImage, x, y);
    e.Graphics.DrawString(drawString, drawFont, drawBrush, drawRect);

    on a panel (OnPaint) and everything works fine untill the 4-item right menu is clicked and then dissmised;
    the menu leaves a blank spot (the size of menu, the color of form's back color) untill the control (panel) refreshes (the more elements are dawn the longer it takes); is there any way to block panel's refresh call?
    i guess if i do the same using labels and pictureboxes the problem does not occur;

    thanks in advance!
    Thursday, August 27, 2009 12:09 PM

Answers

  • I already found out what I was doing wrong(?); I used Form_Paint event instead of overriding form's OnPaint method;
    CF "double buffering" (http://msdn.microsoft.com/en-us/library/aa446518.aspx) seems to have different effect when mainmenu is used (_Paint event leaves that blank spot after menu is dismissed, OnPaint does not);
    I guess I did not know that - sorry I am still learning;)
    thank you very much anyways;
    Marek
    • Marked as answer by mar.jan1 Tuesday, September 1, 2009 10:07 AM
    Tuesday, September 1, 2009 9:38 AM

All replies

  • Hi,

    Does the OnPaint method get called after the menu is dismissed?

    Thanks

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Thursday, August 27, 2009 12:18 PM
  • Hello Paul,

    Having read your post I went through my code and run my app once again;
    my observation was wrong; it looks like cancelling the menu triggers the panel getting redrawn, however not the whole panel - only the rectangle (that blank spot) that is left after menu is dismissed;

    is there any way that happens due to too many elements on the control??

    answering your question, yes it does later on;

    thanks,
    Marek
    Thursday, August 27, 2009 12:43 PM
  • The information you provided doesn't seem to be enough to tell the cause. Could you post the detailed repro steps (the environment, the steps, a more complete source code, the expected and the actual results, etc.)?


    Please mark the post that helps you, and unmark that does not. This benefits our community members.
    Monday, August 31, 2009 10:07 AM
  • I already found out what I was doing wrong(?); I used Form_Paint event instead of overriding form's OnPaint method;
    CF "double buffering" (http://msdn.microsoft.com/en-us/library/aa446518.aspx) seems to have different effect when mainmenu is used (_Paint event leaves that blank spot after menu is dismissed, OnPaint does not);
    I guess I did not know that - sorry I am still learning;)
    thank you very much anyways;
    Marek
    • Marked as answer by mar.jan1 Tuesday, September 1, 2009 10:07 AM
    Tuesday, September 1, 2009 9:38 AM