VC++: Can we create a transparent control?
Can we create a transparent control?
Yes, use following code to create transparent control.
HBRUSH OnCtlColor ( CDC *p, CWnd *w, UINT c )
{
brush.CreateStockObject ( NULL_BRUSH ) ;
p -> SetBkMode ( TRANSPARENT ) ;
return ( HBRUSH ) brush.m_hObject ;
}
brush is an object of CBrush. Whenever a control is drawn OnCtlColor( ) gets called. We have created a NULL brush in it and returned handle to that brush. The control is now drawn with a NULL brush.




Comments
Log in or create a user account to comment.