0

I have a win forms application. The form contains a third party chart from dotnetcharting. The form also has a few other controls which allows the user to select the type of chart they wish to see.

The issue I have is when the user clicks the button to plot the chart nothing appears to happen (it is though), so the chart is blank. However when I go to another application, a word document, or web page or whatever and then go back to my win forms application the chart now appears. Why is this?

Is this to do with win forms or the chart? Is there some refresh I need to do?

mHelpMe
  • 6,336
  • 24
  • 75
  • 150

2 Answers2

1

I think it has to do with the refreshing, please try to put the line:

Application.DoEvents();

after the data is being updated. It should then change the form.

GeorgDangl
  • 2,146
  • 1
  • 29
  • 37
0

Difficult to say without more information.
Sounds like you have to invalidate the control which sounds odd for a third party control.

Possibly there is a function on the control to tell it to redraw or that you are finished with calculating. Did you check the documentation on usage?
Some controls can be paused from updating the UI to let them handle lots of data and restarted after you finished with the data.

Post some more info on usage and code

Uwe Hafner
  • 4,889
  • 2
  • 27
  • 44
  • ah yes your correct - there is RefreshChart method. Couldn't actually find that method in the documentation but saw it a method of the chart – mHelpMe Nov 22 '14 at 14:51