saksp wrote:
I have inserted a combo-box control in my project. In that control vertical scroll bar is present. I want horizontal scroll bar also. how to attach horizontal scroll bar to control
First edit .rc file to add WS_HSCROLL to combo box style codes since dialog does not support this. Then use this function, I've for demo purpose given 600, you need to use GetTextExtent function to get the real extent, look up MSDN for SetHorizontalExtent sample code...
void CDialoTestDlg::AddHScroll()
{
CComboBox* pCmb = (CComboBox*)GetDlgItem(IDC_COMBO_HORZ_EXTENT);
ASSERT( pCmb );
pCmb->SendMessage( CB_SETHORIZONTALEXTENT, 600, 0 );
}
Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com