Getting Static control styles [MFC]
-
Hi. So, i got my custom static control (class which inherits from CStatic), which displays a text on a dialog window and thats it. Now i am trying to determine its style, which was sat in resource editor. For example, center image was sat, SS_CENTERIMAGE, so i am doing this:
DWORD dwStyle = this->GetStyle();
if((dwStyle & SS_CENTERIMAGE) == TRUE)
{
::AfxMessageBox(L"center image");
}It is not working. Nothing is working actually. I am trying to check text alignment - not working, what am i doing wrong? Thanks.
011011010110000101100011011010000110100101101110 0110010101110011
-
Hi. So, i got my custom static control (class which inherits from CStatic), which displays a text on a dialog window and thats it. Now i am trying to determine its style, which was sat in resource editor. For example, center image was sat, SS_CENTERIMAGE, so i am doing this:
DWORD dwStyle = this->GetStyle();
if((dwStyle & SS_CENTERIMAGE) == TRUE)
{
::AfxMessageBox(L"center image");
}It is not working. Nothing is working actually. I am trying to check text alignment - not working, what am i doing wrong? Thanks.
011011010110000101100011011010000110100101101110 0110010101110011
csrss wrote:
if((dwStyle & SS_CENTERIMAGE) == TRUE)
&
is not a boolean operation, nor isSS_CENTERIMAGE
equal to1
. Try:if ((dwStyle & SS_CENTERIMAGE) == SS_CENTERIMAGE)
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
-
csrss wrote:
if((dwStyle & SS_CENTERIMAGE) == TRUE)
&
is not a boolean operation, nor isSS_CENTERIMAGE
equal to1
. Try:if ((dwStyle & SS_CENTERIMAGE) == SS_CENTERIMAGE)
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather