|
-
June 29th, 2016, 08:12 AM
#1
Format Edit Control with Spin Control, Leading Zeros
I have an MFC Edit Control with a Spinner and it works pretty good but I want to format the number to a fixed length with leading zeros like this: 000, 001, 012, 123.
I tried to use the Spin Control event UDN_DELTAPOS to read the Edit Controls Member Variable CString and modify it with leading zeros as necessary.
Unfortunately, when this event happens, this Member Variable still contains the OLD value and not the new one.
Is there an event that happens AFTER the Spin Control finishes its work?
Any other suggestions?
I am also limiting the spinner like this:
OnInitDialog()
{
//This part works
//Set range of spin control
CSpinButtonCtrl* SpinControl;
SpinControl = (CSpinButtonCtrl*)GetDlgItem(IDC_spnActual);
SpinControl->SetRange( MinActual, MaxActual );
}
Thanks,
Ken
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|