|I have returned with my "small" problem.
1) Problem was/is that my graphics disappeared when you move them out of screen borders and pull them back or put some other window over them.
2) Graphics are updated every time I move my trackbar (which gives values to function to draw the graphic based on the values)
So I've made some progress, but still stuck on other part.
I have 3 different functions, one for graphic, second for graphic and third for axis.
I solved the paint problem with Axis, since its static and never changes, so it was quite easy to convert to paint event. On the other hand, graphs have both 2 parameters that they receive and the graph changes after that according to the values given.
Example : public void JoonistaGraafik(int k1, int k2)
now when I want to make it to paint event "public void JoonistaGraafik(object sender,PaintEventArgs e, int k1, int k2)"
I have problem calling out in InitializeComponents();
this.GraphPanel.Paint += new System.Windows.Forms.PaintEventHandler(JoonistaGraafik(slider_a, slider_b));
the thing is that, my two values "slider_a" and "slider_b" are generated in the trackbar_scroll event and then JoonistaGraafik(slider_a, slider_b); was called out.
I'm pretty bad in explaining, but I hope that made a bit sence.
In conclusion, the question is, how can I call out
"this.GraphPanel.Paint += new System.Windows.Forms.PaintEventHandler(JoonistaGraafik(slider_a, slider_b));"
if the slider_a and slider_b values have to change when I move the trackbar.
Or how can I make a paint event which gets values from trackbars (means the graphic has to update itself every time trackbar is moved).
Thanks for reading, and I hope someone can help me out (again).