Click here to Skip to main content
16,004,479 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
Hi.

I am currently modifying an MFC application that has a static text control associated with a custom class (derived from CStatic) into which are drawn several buttons in a pyramid structure. I need to modify the application to add more buttons to the structure but this results in the additional buttons being drawn outside the edges of the static control.

I need to add a horizontal scrollbar to the static control so the User can view the additional controls but I've not been able to figure this out. I have tried converting the static control to a multiline edit control (CEdit) and enabling the scrollbar property but this seems to ignore the controls and only displays the scrollbar when actual text is added to the control, which is not what I want.

Can anyone advise me how to enable scrolling of the static control so the whole view can be seen by the user?

Note that I tried to attach a screenshot to this question to show the application but I can't figure out how to do this!
Posted
Comments
nv3 29-Aug-13 6:49am    
Have you tried to give your static control the window style WS_HSCROLL?
AlBurns 29-Aug-13 6:53am    
I'm not sure how to do this as the control class is associated with the MFC control using DDX_Control in the data map of the container, it is not actually created in the code.
nv3 29-Aug-13 7:18am    
DDX has nothing to do with this. The control is probably created by a dialog template. So go into the resource editor, open the dialog template, select the static control, and add the window style.
AlBurns 29-Aug-13 7:23am    
Unfortunately I have not much experience with MFC so am a bit confused as to where this is set. I have selected the control on the dialog in the resource editor but cannot see where to set the style. I am using Visual Studio 2010.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900