Problem with form pixels and open gl


I develop an application in visual that contains both vb controls and opengl. The problem is that the visual basic in forms uses pixels and opengl does not. I tried to make the conversion :

x = -1+(2/Form1.width)*x_coord_in_pixels
y = 1 - +(2/Form1.height)*y_coord_in_pixels

Gl.glRectf(x, y, x + 0.25, y + 0.25)

but i see that the coordinates in my form are still different from theese in opengl. It is a litle bit confusing but i hope you understand. If you don’t please tell me and I will explain more

Thank you

Would u explain what exactly are you trying to do…?? I mean why are u converting it…?? what is the problem u r trying to solve.??

Well, my form contains both opengl components that i have created and .net controls. The problem is that I control the object’s position dynamicaly, so when I say that the .net button is in position (100,200) the opengl component (for example a rectangle) should have the SAME position.

holly god! It was the border of the form! I should disable it…
Thanks anyway