CtreeCtrl
-
Hello Friends, I am Having a tree ctrl in a dialog box now when i set the checkbox property of the tree ctrl then there is a very Long Horizontal scroll bar at the bottom of the TreeCtrl. This scroll bar is very long even if the length of the string inserted in the treectrl is small Can anyone help me out in removing the horizontal scroll, but i want the Vertical Scroll... Thanx TAKE CARE
-
Hello Friends, I am Having a tree ctrl in a dialog box now when i set the checkbox property of the tree ctrl then there is a very Long Horizontal scroll bar at the bottom of the TreeCtrl. This scroll bar is very long even if the length of the string inserted in the treectrl is small Can anyone help me out in removing the horizontal scroll, but i want the Vertical Scroll... Thanx TAKE CARE
Is your dialog based on a prepared resource ? If it is, then override the OnCreate method of your dialog class, and first call the base class to create the dialog and control windows. Use Class Wizard to bind a control member for the tree control. When the base class call returns, use the member variable to check if the control window is created (m_hWnd member of variable is not null) Set the window style flags using the member variable and ModifyStyle method to remove the WS_HSCROLL flag. This will remove the horizontal scrollbar. If you create the list control dynamically, you can leave the WS_HSCROLL flag out from the Create method call. This will remove the horizontal bar. Including the WS_VSCROLL flag will ensure that the vertical scroll bar remains. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.
-
Is your dialog based on a prepared resource ? If it is, then override the OnCreate method of your dialog class, and first call the base class to create the dialog and control windows. Use Class Wizard to bind a control member for the tree control. When the base class call returns, use the member variable to check if the control window is created (m_hWnd member of variable is not null) Set the window style flags using the member variable and ModifyStyle method to remove the WS_HSCROLL flag. This will remove the horizontal scrollbar. If you create the list control dynamically, you can leave the WS_HSCROLL flag out from the Create method call. This will remove the horizontal bar. Including the WS_VSCROLL flag will ensure that the vertical scroll bar remains. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.
Antti Keskinen wrote: Set the window style flags using the member variable and ModifyStyle method to remove the WS_HSCROLL flag. This will remove the horizontal scrollbar. well but what if I really have something in my tree control which needs to have a horizontal scrollbar
-
Antti Keskinen wrote: Set the window style flags using the member variable and ModifyStyle method to remove the WS_HSCROLL flag. This will remove the horizontal scrollbar. well but what if I really have something in my tree control which needs to have a horizontal scrollbar
I believe the only option for the tree control here is that the horizontal scrollbar is either on or off. If you need a special implementation (variable on/off scrollbar), then derive from CTreeCtrl and draw the horizontal scrollbar yourself when necessary. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.
-
I believe the only option for the tree control here is that the horizontal scrollbar is either on or off. If you need a special implementation (variable on/off scrollbar), then derive from CTreeCtrl and draw the horizontal scrollbar yourself when necessary. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.
Thank you Friends it works.... Thanx TAKE CARE