Click here to Skip to main content
15,911,141 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAsk for help: how can I re-appear such appearance? Pin
chenxiujie21-Dec-05 15:05
chenxiujie21-Dec-05 15:05 
AnswerRe: Ask for help: how can I re-appear such appearance? Pin
Aamir Butt21-Dec-05 19:34
Aamir Butt21-Dec-05 19:34 
GeneralRe: Ask for help: how can I re-appear such appearance? Pin
GflPower21-Dec-05 20:05
GflPower21-Dec-05 20:05 
AnswerRe: Ask for help: how can I re-appear such appearance? Pin
kakan21-Dec-05 21:03
professionalkakan21-Dec-05 21:03 
QuestionView message handling Pin
MrNed21-Dec-05 13:59
MrNed21-Dec-05 13:59 
AnswerRe: View message handling Pin
Owner drawn21-Dec-05 19:30
Owner drawn21-Dec-05 19:30 
QuestionOpenEx function problem Pin
mhar21-Dec-05 13:27
professionalmhar21-Dec-05 13:27 
QuestionHelp wanted with CSpinButtonCtrl Pin
cgb14321-Dec-05 12:11
cgb14321-Dec-05 12:11 
I have an CSpinButtonCtrl autobuddied with an EditBox. How can I get the CSpinButtonCtrl to inc/dec in 2's as I only want even numbers to appear in the EditBox and by default the CSpinButtonCtrl inc/decs in 1's.
Follows is a stripped down version of my implementation
In the .h file I declare
class C_VIEW : public CDialog<br />
{<br />
// Construction<br />
public:<br />
C_VIEW(CWnd* pParent = NULL);   // standard constructor<br />
// Dialog Data<br />
//{{AFX_DATA(C_VIEW)<br />
CSpinButtonCtrl	m_spinner;<br />
//}}AFX_DATA<br />
};

In the .cpp file I implement
void C_VIEW::DoDataExchange(CDataExchange* pDX)<br />
{<br />
  CDialog::DoDataExchange(pDX);<br />
  //{{AFX_DATA_MAP(C_VIEW)<br />
  DDX_Control(pDX, IDC_SPINNER, m_spinner);<br />
  //}}AFX_DATA_MAP<br />
}

In the initialisation routine I set the min/max range
BOOL C_VIEW::OnInitDialog() <br />
{<br />
  CDialog::OnInitDialog();<br />
  m_spinner.SetRange(0, 100);<br />
}

the value is saved when the dialog box is closed.
void C_VIEW::OnOK() //called when OK button is pressed in dialog box<br />
{<br />
  save_all_values();<br />
  CDialog::OnOK();<br />
}

I thought of rounding the value as it is saved, but that is not elegant and would misguide a user who had selected an odd value.

cgb143
AnswerRe: Help wanted with CSpinButtonCtrl Pin
PJ Arends21-Dec-05 12:49
professionalPJ Arends21-Dec-05 12:49 
GeneralRe: Help wanted with CSpinButtonCtrl Pin
Blake Miller22-Dec-05 5:59
Blake Miller22-Dec-05 5:59 
AnswerRe: Help wanted with CSpinButtonCtrl Pin
Owner drawn21-Dec-05 19:28
Owner drawn21-Dec-05 19:28 
GeneralRe: Help wanted with CSpinButtonCtrl Pin
cgb14322-Dec-05 3:47
cgb14322-Dec-05 3:47 
GeneralRe: Help wanted with CSpinButtonCtrl Pin
Owner drawn22-Dec-05 16:58
Owner drawn22-Dec-05 16:58 
GeneralRe: Help wanted with CSpinButtonCtrl Pin
Blake Miller22-Dec-05 6:00
Blake Miller22-Dec-05 6:00 
GeneralRe: Help wanted with CSpinButtonCtrl Pin
cgb14322-Dec-05 10:01
cgb14322-Dec-05 10:01 
GeneralRe: Help wanted with CSpinButtonCtrl Pin
Blake Miller22-Dec-05 10:08
Blake Miller22-Dec-05 10:08 
QuestionNedd help/direction to create a UI Pin
Klerik8221-Dec-05 10:11
Klerik8221-Dec-05 10:11 
AnswerRe: Nedd help/direction to create a UI Pin
TheGreatAndPowerfulOz21-Dec-05 10:20
TheGreatAndPowerfulOz21-Dec-05 10:20 
GeneralRe: Nedd help/direction to create a UI Pin
Klerik8221-Dec-05 10:27
Klerik8221-Dec-05 10:27 
GeneralRe: Nedd help/direction to create a UI Pin
TheGreatAndPowerfulOz21-Dec-05 10:35
TheGreatAndPowerfulOz21-Dec-05 10:35 
GeneralRe: Nedd help/direction to create a UI Pin
David Crow21-Dec-05 10:36
David Crow21-Dec-05 10:36 
QuestionRun hidden on startup Pin
lynchspawn21-Dec-05 9:48
lynchspawn21-Dec-05 9:48 
AnswerRe: Run hidden on startup Pin
TheGreatAndPowerfulOz21-Dec-05 9:54
TheGreatAndPowerfulOz21-Dec-05 9:54 
GeneralRe: Run hidden on startup Pin
Blake Miller22-Dec-05 6:04
Blake Miller22-Dec-05 6:04 
AnswerRe: Run hidden on startup Pin
Rajesh R Subramanian21-Dec-05 17:17
professionalRajesh R Subramanian21-Dec-05 17:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.