Hi, I am creating SkinList Ctrl using Create method as shown below m_pUserListCtrl = new CSkinListCtrl(); bReturn=m_pUserListCtrl->Create(WS_CHILD|WS_VISIBLE|LVS_REPORT|LVS_NOCOLUMNHEADER|LVS_SINGLESEL,rect,this,0x28); DWORD dwStyle = m_pUserListCtrl->GetExtendedStyle()|LVS_EX_FULLROWSELECT|LVS_SHOWSELALWAYS|LVS_EX_SUBITEMIMAGES; m_pUserListCtrl->SetExtendedStyle(dwStyle); I am facing below listed problems 1) if I use WS_BORDER in Create,If an Item is selected the borders are getting overlapped. 2) If I minimize and maximize the Dialog the List control is not repainted. (Case: if any item is selected in listcontrol and then the dialog box is minimized and then maximized this case is causing problem , I used Invalidate(TRUE) in OnCustomDrawList() it was working fine for this case but the CPU useage was going to 100%, I also tried to invalidate the list control during SC_MAXIMIZE and SC_RESTORE of dialog but still it is not working)
ReplyI used this in Windows not in dialogs, but its not working as it shud...
I used it like this-
///////////
class CMainWindow : public CFrameWnd // <<===
{
private:
CEdit m_WndName;
// CColorEdit m_cEdit;
CSkinListCtrl m_SkinList; // <<===
......
};
////////
and used all other files as u explained in the article, but sorry, it was not working...only scrollbars were visible no listbox visible there in window..
Any help will be gratefull..
Reply
Originally posted by: Akram
I modified the skin list contrl to show icon on the right
side. Also I added code to handle the owner draw property of list control.
Originally posted by: justin77
I do it myself step by step,as what you said.
It can compile properly, but I can't run it.
void CSkinListCtrl::PreSubclassWindow()
{
//use our custom CHeaderCtrl
##??## m_SkinHeaderCtrl.SubclassWindow(GetHeaderCtrl()->m_hWnd);
CListCtrl::PreSubclassWindow();
}
"0x00403365" instruction cited "0x00000020"memory,
this memory can't be read.
Could you help me?
If your want to know more details about it, please email me
GetHeaderCtrl()->m_hWnd is a illegal handle here. Place subClassWindow function in OnCreate()
Replybut scrollbars r not displayed attached to list ctrl. they r separated apart...try to run it for few times...Reply
This problem let my hairs grayed, too. The solution is very simple. You should delete the complete PreSubclassWindow() function. Then call a dedicated SubclassWindow() after creation the control. Example: m_liste.Create(WS_VISIBLE | LVS_REPORT | LVS_SHOWSELALWAYS,CRect(0,0,0,0),this, ID_CLIENT_LIST); m_liste.m_SkinHeaderCtrl.SubclassWindow(m_liste.GetHeaderCtrl()->m_hWnd); First create the control (m_liste) Than subclass the Header. Now it works.
ReplyI also confront this problem.If the SkinListCtrl is created in Dialog Template and use ClassWizzard, that' OK;but when I use Create() to create it by myself,the error occurs.
ReplyOriginally posted by: Caprice
You really think that LoadBitmap, CreateFontIndirect inside of OnPaint can be a kind of something useful?
And the skinning is just a fashion. Instead of abuse the list control you can write your own control from zero with functionalities that you need. And you tried to implement it but with MFC and propose to use it with stupid wizards. Sorry, if I did not understand something.
Reply
Originally posted by: Sanjeev
It is a good article and will save plenty of hours for others who are willing to have a similar look for their application!!!
Originally posted by: Mohini Sathe
Excellent work, also an ideal article.
I like the way you create your own ListControl that gives advanced UI. But loading Bitmap took lot of time, so initially while starting application took lot of time.
Also inserting large no. of records with bitmap loading will be a tough job.
Originally posted by: wwdz99
a good article
Reply
Originally posted by: Imran
Good effort to civilised Microsoft CListCtrl control under
MFC. But the entire code works effectively when control
only configured under design enviornment i.e. List Control
properties->Report mode.
There are further three mode i.e. Icon, Small Icon, List
modes does not supported by this code, and if control
configured then it crash.
There is little extra coding work involve to get around
this remedy!
Originally posted by: Ajay
Article is excellent! I have compiled and ran but did not see how it does that. Skinning is very well but the client color are not having good UI. Please increase readibility by setting fonts and back/fore colors.
Thanx.
Reply