how can I warn to make a choice for numeric edit box?
-
when I use string ,I can write m_StringeditBox.GetWindowText (str); if(str.IsEmpty()){ MessageBox("please,choose one of them ! "); return; } like tihs ! if I use edit box for numeric value how can I warn ? emroz
-
when I use string ,I can write m_StringeditBox.GetWindowText (str); if(str.IsEmpty()){ MessageBox("please,choose one of them ! "); return; } like tihs ! if I use edit box for numeric value how can I warn ? emroz
In the same way.
-
In the same way.
it didn't work:( emroz
-
it didn't work:( emroz
How about a code snippet?
-
when I use string ,I can write m_StringeditBox.GetWindowText (str); if(str.IsEmpty()){ MessageBox("please,choose one of them ! "); return; } like tihs ! if I use edit box for numeric value how can I warn ? emroz
i do it by adding a variable for the edit box to the class. right click on m_StringeditBox class, go to add variable. Select 'control' from the check boxe, and change "Category:" to variable. add a variable name, and add min. and max. value and you're set, it makes it mandatory for a user to enter something. *.* cin >> knowledge;
-
How about a code snippet?
When I add information to access table ,I use this code ! set.m_access_attribute = GetDlgItemInt (IDC_EDIT1); How can I warn to fill edit box ? emroz
-
When I add information to access table ,I use this code ! set.m_access_attribute = GetDlgItemInt (IDC_EDIT1); How can I warn to fill edit box ? emroz
I don't use
GetDlgItemInt()
(see below), but if that is what you are limited to, you'll want to use its second parameter, lpTrans. If it is 0 upon return, an error was encountered in translating the edit control text. This includes being empty. Whether I'm dealing with letters, numbers, or a combination of the two, I extract edit box data usingGetWindowText()
. It's easy to check for emptiness, and if the end result needs to be stored in a number,atoi()
is only a function call away.