I am trying to print information that is held in a CListView in report mode. I have about 12 - 15 columns that have been sized to the header and text in the column below with a LVSCW_AUTOSIZE_USEHEADER and then the user may have changed the widths of any colunn by moving the header separators. I want to replicate this column information (not necessarily in the same columns) in fields on the printed output.
I can get the width of each column in pixels from the LV_COLUMN struct but I'm not sure how to get the average number of characters that the column is sized for. If I could get the font that the list control is using then I could ask text metrics for the average character width and from that get the number of average chacters in each column. Since I know the printer font, I can size the printer fields to match the list control fields.
Basic question is: How can I ask the system for the font that a list control is using?
Can the user change a list control font?
Do different machines have different list control fonts?
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms. Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go. MFC has a very cool system for handli…
The undo support, implementing a stack.
Continuing from the eigth article about sudoku.
We need a mechanism to keep track of the digits entered so as to implement an undo mechanism. This should be a ‘Last In First Out’ collec…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…