PDA

Click to See Complete Forum and Search --> : hwnd, hdc, parent


Pooka
Jul 6th, 2000, 04:57 PM
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

prye
Jul 6th, 2000, 05:12 PM
if you want to get the controls height/width, im sure GetwindowRect will do that. As long as you have its handle and hdc

Sam Finch
Jul 6th, 2000, 05:37 PM
It's Much Easier than that, Usercontrol.Parent.Height gives the parent height, Usercontrol.Parent.Width gives the parent width.