![]() |
| | #1 |
| mustang benny Join Date: Jul 2002
Posts: 1,401
| BN_CLICKED, change button style Code: case BN_CLICKED:
SendMessage((HWND) lParam, BM_SETSTYLE,
(WPARAM) LOWORD(BS_TOP),
MAKELPARAM(TRUE, 0));
break;
__________________ benforbes@optusnet.com.au Microsoft Visual Studio .NET 2003 Enterprise Architect Windows XP Pro Code Tags Programming FAQ Tutorials |
| bennyandthejets is offline | |
| | #2 | ||
| Registered User Join Date: Mar 2002
Posts: 346
| I have not used that message before, but here is the documentation I have on it: Quote:
Quote:
- Sean
__________________ If cities were built like software is built, the first woodpecker to come along would level civilization. Black Frog Studios | ||
| sean345 is offline | |
| | #3 |
| mustang benny Join Date: Jul 2002
Posts: 1,401
| i think i have that some documentation, so that doesn't really help at all. according to the doco, everything im doing is right. so whats wrong?
__________________ benforbes@optusnet.com.au Microsoft Visual Studio .NET 2003 Enterprise Architect Windows XP Pro Code Tags Programming FAQ Tutorials |
| bennyandthejets is offline | |
| | #4 |
| Refugee Join Date: Aug 2001
Posts: 2,052
| another useless post... >>so whats wrong? You!
__________________ Please direct all complaints regarding this post to the nearest brick wall Have a nice day. |
| face_master is offline | |
| | #5 |
| mustang benny Join Date: Jul 2002
Posts: 1,401
| what r u trying to say face master?
__________________ benforbes@optusnet.com.au Microsoft Visual Studio .NET 2003 Enterprise Architect Windows XP Pro Code Tags Programming FAQ Tutorials |
| bennyandthejets is offline | |
| | #6 |
| train spotter Join Date: Aug 2001 Location: near a computer
Posts: 3,450
| Check the HWND you are using. Also the LPARAM is just TRUE (or non zero). Try Code:
SendMessage(GetDlgItem(hWnd,ID_BUTTON)
,BM_SETSTYLE
,(WPARAM)BS_TOP
,(LPARAM)1);//true redraws button
Code: case WM_COMMAND:
{
idControl = GET_WM_COMMAND_ID(wParam, lParam) ;
switch(idControl)
case ID_BUTTON:
if (BN_CLICKED == HIWORD(wParam))
{//button clicked code
__________________ "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 | |
| | #7 |
| mustang benny Join Date: Jul 2002
Posts: 1,401
| it still doesn't work. i know the code is being reached, so the problem must lie with the SendMessage() function. Code: SendMessage(GetDlgItem(hwnd,ID_OK) ,BM_SETSTYLE ,(WPARAM)BS_TOP ,(LPARAM)1);//true redraws button
__________________ benforbes@optusnet.com.au Microsoft Visual Studio .NET 2003 Enterprise Architect Windows XP Pro Code Tags Programming FAQ Tutorials |
| bennyandthejets is offline | |
| | #8 |
| Registered User Join Date: Mar 2002
Posts: 346
| Maybe there is little to no visual change between the two styles. - Sean
__________________ If cities were built like software is built, the first woodpecker to come along would level civilization. Black Frog Studios |
| sean345 is offline | |
| | #9 |
| train spotter Join Date: Aug 2001 Location: near a computer
Posts: 3,450
| Try getting the buttons style and adding the BS_TOP. (which only draws the text near the top of the button) try BS_FLAT to see if it changes. Call UpdateWindow() with the hWnd of the Buttons Dialog.
__________________ "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 | |
| | #10 |
| mustang benny Join Date: Jul 2002
Posts: 1,401
| how do i get the style of the button? my documentation only has BM_SETSTYLE, no BM_GETSTYLE. however, i dont think that would work, because when my buttons are created, they are created with the WS_CHILD and WS_VISIBLE styles. therefore, if i sent a change style message not including those 2 styles, things would be majorly messed up. so obviously it is not just a matter of adding BS_TOP or whatever to the existing styles.
__________________ benforbes@optusnet.com.au Microsoft Visual Studio .NET 2003 Enterprise Architect Windows XP Pro Code Tags Programming FAQ Tutorials |
| bennyandthejets is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MFC: Change the color of static text with button press? | BrianK | Windows Programming | 2 | 06-16-2004 11:03 PM |
| Tab Controls - API | -KEN- | Windows Programming | 7 | 06-02-2002 09:44 AM |
| disabling button in another prog | timmygax | Windows Programming | 11 | 10-29-2001 03:40 PM |
| How To Change Caption's On A Button When It Is Click ? | SonicWave | Windows Programming | 1 | 09-19-2001 02:14 PM |
| trying to make change from the price of the item and the amount given. please help!!! | tobyman | C++ Programming | 2 | 09-04-2001 02:12 PM |