Set button style
-
Can you suggest me a way to change dynamically the button style from bitmap to text and viceversa? I tried with
m_BUTT_25.SetButtonStyle(BS_TEXT); m_BUTT_25.RedrawWindow();
andm_BUTT_25.SetButtonStyle(BS_BITMAP); m_BUTT_25.RedrawWindow();
but nothing seems to happen... :( I can instead change the button caption withSetWindowText
: why is this? :confused: Thanks :), Marco. -
Can you suggest me a way to change dynamically the button style from bitmap to text and viceversa? I tried with
m_BUTT_25.SetButtonStyle(BS_TEXT); m_BUTT_25.RedrawWindow();
andm_BUTT_25.SetButtonStyle(BS_BITMAP); m_BUTT_25.RedrawWindow();
but nothing seems to happen... :( I can instead change the button caption withSetWindowText
: why is this? :confused: Thanks :), Marco.Not all styles can be changed at runtime, this might very well be an example. A common method is to destroy and recreate the button. marcomars wrote: I can instead change the button caption with SetWindowText: why is this? Because the text is not a style.
-
Can you suggest me a way to change dynamically the button style from bitmap to text and viceversa? I tried with
m_BUTT_25.SetButtonStyle(BS_TEXT); m_BUTT_25.RedrawWindow();
andm_BUTT_25.SetButtonStyle(BS_BITMAP); m_BUTT_25.RedrawWindow();
but nothing seems to happen... :( I can instead change the button caption withSetWindowText
: why is this? :confused: Thanks :), Marco. -
Can you suggest me a way to change dynamically the button style from bitmap to text and viceversa? I tried with
m_BUTT_25.SetButtonStyle(BS_TEXT); m_BUTT_25.RedrawWindow();
andm_BUTT_25.SetButtonStyle(BS_BITMAP); m_BUTT_25.RedrawWindow();
but nothing seems to happen... :( I can instead change the button caption withSetWindowText
: why is this? :confused: Thanks :), Marco.How about creating two buttons, one with text and the other with a bitmap? Disable/enable them accordingly. marcomars wrote: I can instead change the button caption with SetWindowText: why is this? Because that's the way it is supposed to work. Per MSDN: The SetWindowText function changes the text of the specified window's title bar (if it has one). If the specified window is a control (e.g., button), the text of the control is changed.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen