-
I'm trying to make a custom control that can be dropped onto any form or into any picture box and create a grid either under or over whatever controls and graphics are already there. I have it mostly worked out, but I'm having some trouble getting the parents width & height.
I know that through API calls, I can get a parents hwnd & hdc. Once I have those, is there a way to get the width of that parent either through another api call (or even something much more mundane?) without setting it implicitly from the parent?
Thanks much!
Jody
-
if you want to get the controls height/width, im sure GetwindowRect will do that. As long as you have its handle and hdc
-
It's Much Easier than that, Usercontrol.Parent.Height gives the parent height, Usercontrol.Parent.Width gives the parent width.