Click here to Skip to main content
16,010,544 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: format the value of Spin & Edit? Pin
David Crow25-Apr-06 4:41
David Crow25-Apr-06 4:41 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master25-Apr-06 5:00
zeus_master25-Apr-06 5:00 
GeneralRe: format the value of Spin & Edit? Pin
David Crow25-Apr-06 5:11
David Crow25-Apr-06 5:11 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master25-Apr-06 6:20
zeus_master25-Apr-06 6:20 
GeneralRe: format the value of Spin & Edit? Pin
David Crow25-Apr-06 6:30
David Crow25-Apr-06 6:30 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master25-Apr-06 15:33
zeus_master25-Apr-06 15:33 
GeneralRe: format the value of Spin & Edit? Pin
Nibu babu thomas25-Apr-06 17:18
Nibu babu thomas25-Apr-06 17:18 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master25-Apr-06 18:38
zeus_master25-Apr-06 18:38 
thank you very much for your suggestion,
I removed the style UDS_SETBUDDYINT, and added the code below.

void CFlexgridDlg::OnDeltaposSpin1(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here


BYTE str;
str = m_UpDown.GetPos();
m_edit.Format("%02x",str);
m_edit.MakeUpper();
UpdateData(false);

*pResult = 0;
}

the text of the edit display the hex string I want now.


but I met another problem is if how to limit input value from keyboard of the edit is hex string format.
CEdit m_edit1Ctrl;
CString m_edit;


void CFlexgridDlg::OnChangeEdit1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.

// TODO: Add your control notification handler code here
char chartemp;
char edit1sel;
UpdateData(TRUE);

edit1sel = m_edit1Ctrl.GetSel();
if(edit1sel)
chartemp = m_edit.GetAt(edit1sel-1);
else
chartemp = 0x00;

if(!(isxdigit(chartemp)))
{
m_12.SetSel(edit1sel-1,edit1sel);
m_12.Clear();

}

UpdateData(false);
}


the code can work well while the edit is not a buddy of the spin, if set edit as a buddy of the spin. the error occurs, UpdateData() cann't work here?
GeneralRe: format the value of Spin & Edit? Pin
Nibu babu thomas26-Apr-06 18:43
Nibu babu thomas26-Apr-06 18:43 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master26-Apr-06 19:00
zeus_master26-Apr-06 19:00 
GeneralRe: format the value of Spin & Edit? Pin
David Crow26-Apr-06 2:47
David Crow26-Apr-06 2:47 
Questionreading from database Pin
aguest25-Apr-06 1:17
aguest25-Apr-06 1:17 
AnswerRe: reading from database Pin
sujtha25-Apr-06 1:30
sujtha25-Apr-06 1:30 
AnswerRe: reading from database Pin
David Crow25-Apr-06 4:50
David Crow25-Apr-06 4:50 
QuestionError loading my resources with imported dlls Pin
snir_ya25-Apr-06 0:49
snir_ya25-Apr-06 0:49 
AnswerRe: Error loading my resources with imported dlls Pin
voorugonda prashanth25-Apr-06 1:18
voorugonda prashanth25-Apr-06 1:18 
QuestionSIZING the Window Pin
RockyJames25-Apr-06 0:47
RockyJames25-Apr-06 0:47 
QuestionRe: SIZING the Window Pin
David Crow25-Apr-06 4:52
David Crow25-Apr-06 4:52 
QuestionAssert failed in wincore Pin
sujtha25-Apr-06 0:39
sujtha25-Apr-06 0:39 
AnswerRe: Assert failed in wincore Pin
voorugonda prashanth25-Apr-06 1:27
voorugonda prashanth25-Apr-06 1:27 
GeneralRe: Assert failed in wincore Pin
sujtha25-Apr-06 1:32
sujtha25-Apr-06 1:32 
AnswerRe: Assert failed in wincore Pin
Naveen25-Apr-06 1:35
Naveen25-Apr-06 1:35 
GeneralRe: Assert failed in wincore Pin
sujtha25-Apr-06 1:40
sujtha25-Apr-06 1:40 
GeneralRe: Assert failed in wincore Pin
Naveen25-Apr-06 1:50
Naveen25-Apr-06 1:50 
GeneralRe: Assert failed in wincore Pin
sujtha25-Apr-06 2:20
sujtha25-Apr-06 2:20 

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.