Hi all I hope in an answer that could help me about my problem because I'm going crazy.
I'm creating a GUI in Visual C++ .NET and I'd like to split the "Spin Control" in two buttons.
I created an editbox with a spin, only to test the code, and the result is this:
See Image1
Here the code that I wrote:
The spin control:
The letters in the editbox:Code:CSpinButtonCtrl *spin = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN_ROTOR_TEST); spin->SetRange(0, 25); spin->SetPos(0); GetDlgItem(IDC_ROTORTEXT)->SetWindowText("A");
But now I have to split the spin into two buttons that interact with the editbox, to increase/decrease the letters, like this:Code:void CTestDlg::onShowposSpinStr(NMHDR* pNMHDR, LRESULT* pResult) { int nNewPos; char szNumber[][16] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "W", "V", "X", "Y", "Z" }; NM_UPDOWN *pNMUpDown = (NM_UPDOWN*) pNMHDR; nNewPos = pNMUpDown->iPos + pNMUpDown->iDelta; if(nNewPos >= 0 && nNewPos <= 25) { GetDlgItem(IDC_ROTOR3TEXT)->SetWindowText(szNumber[nNewPos]); } *pResult = 0; }
See Image2
I have no idea on how I can do this...
Please someone help me, I'm desperate.



LinkBack URL
About LinkBacks


