How to simulate the visual effect of "button pressed" by changing 3d button element's up-left and down-right border color?  
Author Message
b6s





PostPosted: Windows Forms General, How to simulate the visual effect of "button pressed" by changing 3d button element's up-left and down-right border color? Top

Dear all,

For IME UI widget development, the WM_MOUSEACTIVATE event has to be
dropped by MA_NOACTIVATEANDEAT, and the consequence is that the button
has no visual effect anymore.

Is it possible to simulate the "button pressed" visual effect by
changing 3d button element's up-left and down-right border color

Thank you for your precious time.

Sincerely,
Mike


Windows Forms21  
 
 
b6s





PostPosted: Windows Forms General, How to simulate the visual effect of "button pressed" by changing 3d button element's up-left and down-right border color? Top

After all I use a workaround by only processing "mouse-up" event by switching the button border and face, such as:

private void UpdateAppearance()
{
if (m_wasMouseDown)
{
m_colorTop = Color.DimGray;
m_colorMiddle = Color.DimGray;
m_colorBottom = Color.Black;
m_colorBorder = Color.Gray;
m_colorText = Color.White;
m_buttonBorderStyle = ButtonBorderStyle.Inset;
m_wasButtonPressed = true;
this.Refresh();
}
else
{
if(m_wasButtonPressed) {
m_colorTop = Color.LightGray;
m_colorMiddle = Color.DimGray;
m_colorBottom = Color.Black;
m_colorBorder = Color.Gray;
m_colorText = Color.White;
m_buttonBorderStyle = ButtonBorderStyle.Outset;
this.Refresh();
}
m_wasButtonPressed = false;
}
}