Hi,
How do you reposition/move a control in a dialog box using MFC.
Thank You For Your Help,
Matt
Hi,
How do you reposition/move a control in a dialog box using MFC.
Thank You For Your Help,
Matt
This is similiar to a question I posted last week. This is the line of code I ended up using. Do a search in Help for an explanation on how to use it.
m_ptrCEdit = CWnd::GetNextDlgTabItem(GetFocus(), false);
I used the accelerator table to remap the arrow keys.
Or in a different setting:
m_editDiameterLength.SetFocus();
jumps the focus to the m_editDiameterLength edit box...
It took me two days last week to get this figured out.
'til anon,
Lyle
ps please let us know if it works
how 'bout
//Somewhere in dialog
CWnd* pWnd = GetDlgItem( IDC_MYCONTROL );
//****
....determine new location you want here
//****
pWnd->SetWindowPos( NULL, xLocation, yLocation, 0, 0,
SWP_NOSIZE | SWP_SHOWWINDOW | SWP_NOZORDER );
if you already have a control asscociated with your window such as a CButton or CEdit myControl
//****
....determine new location you want here
//****
m_ctlMyControl.SetWindowPos( NULL, xLocation, yLocation, 0, 0,
SWP_NOSIZE | SWP_SHOWWINDOW | SWP_NOZORDER );
with this function you can also resize your button... of course you have to change those 0s to with and height and get rid of the SWP_NOSIZE flag....
zMan