Posessed picturebox - I need a young priest, an old priest, and some holly water

csharp Mexico
  • 14 years ago

    Guys:

    I draw a pie graph in a pic box using data from SQL, everything works totally cool, until I minimize or resize the form, because the picbox will not redraw itself.

    Now, I already tried all the possible solutions (add the paint code in the paint event, SetStyles, doublebuffering, etc).

    The most I got is to be able to draw the graph again by calling the drawing code from the paint event and passing the picbox (sender) as argument, but inmediately after the drawing function finishes (I can see the graph drawn in a few miliseconds), the picbox goes black again.

    Anyone knows what kind of demon I am dealing with here?

    Thanks

    -Kz

  • 14 years ago

    Guys

    Found the solution: DO NOT use a picture box to draw graphs and stuff, use a panel instead.

    Pictureboxes are possessed and should be avoided at all cost.

    -Kz

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why.”