Link to home
Start Free TrialLog in
Avatar of ashugarg00
ashugarg00

asked on

List Control with LVS_LIST style

I have added a list control from resource onto a dialog box.

CListCtrl m_lcFileView;

Now i want to make the list control style to change to list view like the Tile View in a Notepad Save As Dialog Box when we click the view menu.

I have written the following code to change its style to List view like the Tile view.
I have images of the size 50 pixels width and height both.
When we click any item in this view then text and image both gets selected  but the selection which happens is of the height of the image which is not the actual way it happens in general for any other list control style.

m_lcFileView.ModifyStyle(0,LVS_LIST);
m_lcFileView.ModifyStyle(LVS_ALIGNTOP,LVS_ALIGNLEFT);
m_ilListView.Create(50,50,ILC_COLOR24|ILC_MASK,5,1);
bitmapList.LoadBitmap(IDB_BITMAP_ICON_VIEW);
m_ilListView.Add(&bitmapList,RGB(255,0,255));
m_lcFileView.SetImageList(&m_ilListView,LVSIL_SMALL);

Please help me restore the selection to the height of the text only .
Avatar of mahesh1402
mahesh1402
Flag of India image

Avatar of ashugarg00
ashugarg00

ASKER

can u give me an example of how to fill the LVTILEVIEWINFO  structure to ajust an image of 50 pixels height and width both with text as New Folder.
Fill the structure such that the selection fits to the height of text New Folder.
ASKER CERTIFIED SOLUTION
Avatar of mahesh1402
mahesh1402
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I tried the code but the selection is still of the same height .
Do i have to use an owner drawn list control for this?