Le@rner wrote:
rcText.right = min(rcText.right, sizeText.cx);
try this for the above statement,
rcText.right = rcText.left + sizeText.cx
and try to avoid using unwanted temporary variables, you can simply have as below,
CRect rcLabel;
m_label.GetWindowRect(rcLabel); //get screen co-ordinate for static ctrl
rcLabel.right = rcLabel.left + sizeText.cx; //increase/decrease the rect width
ScreenToClient(rcLabel); // convert screen co-ordinate to client co-ordinate
m_label.MoveWindow(rcLabel); //move the static ctrl to new position
Do your Duty and Don't Worry about the Result