![]() |
| | #1 |
| Registered User Join Date: Oct 2009
Posts: 2
| win32 API EDIT BOX Code:
case IDB_BUTTON:{
if(HIWORD(wParam) == BN_CLICKED){
}
}
break;
tankyou |
| acce55 is offline | |
| | #2 |
| Registered User Join Date: Aug 2006
Posts: 76
| Well, when the button is clicked, grab the text from the first box, convert it to a value (sscanf() perhaps?), do the math, print to a buffer, and set item text. You listed your formula there, do you mean you can't figure out how to enter that in a program? |
| rdrast is offline | |
| | #3 |
| Registered User Join Date: Oct 2009
Posts: 2
| Ok thx for that information, expespecially the SSCANF fucntion. I got it to work. Instead of storing it into a buffer, i made a variable of the float type and stored the getdlgitemtext API FUNCTION into the variable. then used the senddlgitemint to set the edit box to the result |
| acce55 is offline | |
| | #4 |
| train spotter Join Date: Aug 2001 Location: near a computer
Posts: 3,359
| Code: int iNumber=0;
double dResult=0;
char szBuffer[MAX_PATH]={0};
//get the value in the first edt
iNumber = GetDlgItemInt(hWnd, IDC_EDIT1, NULL, TRUE);
//do the math
dResult = iNumber * 3.1 * 2;
//put in a text buffer
_snprintf(szBuffer, MAX_PATH-1, "%f", dResult);
//set the second edit
SetDlgItem(hWnd, IDC_EDIT2, szBuffer);
__________________ "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter." Friedrich Nietzsche "I spent a lot of my money on booze, birds and fast cars......the rest I squandered." George Best "If you are going through hell....keep going." Winston Churchill |
| novacain is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WS_HSCROLL in ES_READONLY edit box error | Homunculus | Windows Programming | 4 | 02-13-2006 08:46 AM |
| Multiline Edit Box Parser | The Brain | Windows Programming | 6 | 11-01-2005 07:15 PM |
| setting fixed floats in edit box | WaterNut | Windows Programming | 4 | 08-13-2004 09:13 AM |
| pthread api vs win32 thread api | Unregistered | Windows Programming | 1 | 11-20-2001 08:55 AM |
| Rich edit control example Win API | Echidna | Windows Programming | 1 | 09-17-2001 02:12 AM |