Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   ListView Doubt (http://www.go4expert.com/forums/listview-doubt-t311/)

hemanth.balaji 22May2005 12:53

ListView Doubt
 
How do you CENTER & BOLD the labels of the columns (i.e headings) using ListView. I did not understand the below found in MSDN..

/*
If a column is added to a list-view control with index 0 (the leftmost column) and with
LVCFMT_RIGHT or LVCFMT_CENTER specified, the text is not right-aligned or centered. The text in the index 0 column is left-aligned. Therefore if you keep inserting columns with index 0, the text in all columns are left-aligned. If you want the first column to be
right-aligned or centered you can make a dummy column, then insert one or more columns with index 1 or higher and specify the alignment you require. Finally delete the dummy column.
*/

Also I want the last column to occupy the remaining width of the window even if resizing of the Main Window takes place.

shabbir 22May2005 18:28

Re: ListView Doubt
 
Quote:

First the explanation of what is unclear to you
When you use the syntax for InsertColumn in a list view you have to specify the index at which that column is inserted. If you specify that as zero the Text align is Left by default and so you cannot Make it right or centered align. To make the left column left align inserting a dummy column with index zero and then at index 1 and then delete the column at index 0 provides us what we want. I hope this clears what you cannot understand from MSDN

Quote:

Also I want the last column to occupy the remaining width of the window even if resizing of the Main Window takes place.
That can be done by specifying the column width same as the size of the listview.

Thanks
Shabbir Bhimani

shabbir 22May2005 18:31

Re: ListView Doubt
 
You have posted in the wrong forums. It should be in MFC/Win32 under Queries and expert comments and not under Codes and projects Section

hemanth.balaji 22May2005 19:17

Re: ListView Doubt
 
Ok i am sorry

shabbir 23May2005 07:01

Re: ListView Doubt
 
Quote:

Originally Posted by hemanth.balaji
Ok i am sorry

Its OK.


All times are GMT +5.5. The time now is 10:12.