I am making a form application. I want to update my image whenever I click a button. I was told that GL.MatrixMode and Viewport() should be in glControl1_Paint. The reason for that is because I have tabs and want to keep the same image when moving tabs back and forth (otherwise my loaded image disappers after I move to tab2 and back to tab1 where there is my image).
I do not know how to call glControl1_Paint in button1. I wrote the code below but it does not work. Could someone help me?
private void glControl1_Paint(object sender, PaintEventArgs e)
private void button1_Click(object sender, EventArgs e)
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
(my graphic functions.......)