|
-
July 14th, 1999, 07:13 AM
#1
CCheckListBox
How do I use the CCheckListBox control. Please let me know step by step.
-
July 14th, 1999, 07:37 AM
#2
Re: CCheckListBox
Hi Martini,
the first step is similar to a normal CListBox, you add one to a dialog in RessourceView. Then you add a member variable of type control to your dialog. Third, open the dialog's header file and look for the definition of this variable. Should be something like
CListBox m_ctlMyListBox;
And the last step is to change the word "CListBox" to "CCheckListBox". That's all. After that you can use the additional members of the CCheckListBox class in your code.
With changing the type of the member control variable you use the subclassing feature of MFC. Nice, isn't it? ;-)
HTH
Martin
-
July 14th, 1999, 08:34 AM
#3
-
July 14th, 1999, 03:05 PM
#4
Re: CCheckListBox
In the Resource Editor, set the style of the ListBox to Owner Draw and Fixed.
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
[email protected]
http://home.earthlink.net/~railro/
-
July 14th, 1999, 11:30 PM
#5
Re: CCheckListBox
seems to give me assertion failure when I click on it. I guess i'm doing something wrong!!
-
July 14th, 1999, 11:42 PM
#6
Re: CCheckListBox
My fault... You also have to check the Has Strings style.
From the MFC source code:
int CCheckListBox::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListBox::OnCreate(lpCreateStruct) == -1)
return -1;
if ((GetStyle() & (LBS_OWNERDRAWFIXED | LBS_HASSTRINGS))
== (LBS_OWNERDRAWFIXED | LBS_HASSTRINGS))
SetItemHeight(0, CalcMinimumItemHeight());
return 0;
}
Sorry... that should fix it.. if it doesn't le'me know.
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
[email protected]
http://home.earthlink.net/~railro/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|