How to get Horizontal Scroll on Property Page?
-
I have an application that displays dialogs as pages within a property sheet. Most of the controls work fine, but I am having trouble getting an edit box with horizontal scroll to work. I have multiline set to true and horizontal scroll set to true in the properties box for the edit box control. I also have vertical scroll set to true - that works. When the dialog is activated, the horizontal bar does not show up. The vertical bar shows up and works. I have tried to add the horizontal scroll dynamically without success. If I place the code in OnInitDialog for the dialog that has the edit control on it, the program errors out in winocc.cpp in CWnd::ModifyStyle on
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite !=NULL)):
The same happens if I place this call in the OnInitDialog for the main Dialog, after the property page has been added to the property sheet. If I put the call to ModifyStyle in a handler for OnShowWindow, the program does not abort, but the horizontal bar does not show up. Any ideas? Code that sets up the page in the property sheet:dlgPropSheet.AddPage((CPropertyPage*) &msgDlg); dlgPropSheet.Create(this, WS_CHILD | WS_VISIBLE, 0); dlgPropSheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT); dlgPropSheet.ModifyStyle(0, WS_TABSTOP);
Code I tried both in OnInitDialog for msgDlg and right after the above code in OnInitDialog for the main dialog:pMsgDlg->m_rawMsg.ModifyStyle(0, WS_HSCROLL);