positioning problems
-
Other than repeated trial and error, how can I figure out the location of my control in code? I am putting two buttons on a CDialog that I want to line up under a couple of CListCtrls. I dont know how to size these since I dont know what areas I am working with. Does one somehow get the number of pixels manually from the IDE? Like if I knew the form is 600 pixels high, I would put my button at 500 pixels if its height is 50. I'm using stuff like:
m\_startsearch.MoveWindow(580,30,70,30); m\_cancelsearch.MoveWindow(580,65,70,30);
I dont know if getclientrect is helpful in this case since I want to position these buttons relative to two other controls on the form, which by trial and error I've positioned the way I want. So if I knew the actual number of pixels in my form I could do the adjustments I suppose. Any ideas on how to make this process more scientific? Thanks, ns
-
Other than repeated trial and error, how can I figure out the location of my control in code? I am putting two buttons on a CDialog that I want to line up under a couple of CListCtrls. I dont know how to size these since I dont know what areas I am working with. Does one somehow get the number of pixels manually from the IDE? Like if I knew the form is 600 pixels high, I would put my button at 500 pixels if its height is 50. I'm using stuff like:
m\_startsearch.MoveWindow(580,30,70,30); m\_cancelsearch.MoveWindow(580,65,70,30);
I dont know if getclientrect is helpful in this case since I want to position these buttons relative to two other controls on the form, which by trial and error I've positioned the way I want. So if I knew the actual number of pixels in my form I could do the adjustments I suppose. Any ideas on how to make this process more scientific? Thanks, ns
You can use CWnd::GetWindowRect to get the location of the controls you wish to align to.
-
Other than repeated trial and error, how can I figure out the location of my control in code? I am putting two buttons on a CDialog that I want to line up under a couple of CListCtrls. I dont know how to size these since I dont know what areas I am working with. Does one somehow get the number of pixels manually from the IDE? Like if I knew the form is 600 pixels high, I would put my button at 500 pixels if its height is 50. I'm using stuff like:
m\_startsearch.MoveWindow(580,30,70,30); m\_cancelsearch.MoveWindow(580,65,70,30);
I dont know if getclientrect is helpful in this case since I want to position these buttons relative to two other controls on the form, which by trial and error I've positioned the way I want. So if I knew the actual number of pixels in my form I could do the adjustments I suppose. Any ideas on how to make this process more scientific? Thanks, ns
Use can use a simple way of resize/move controls in a complex dialog with this http://www.codeproject.com/dialog/easysize.asp[^] Casa.Sapo.pt