|
-
Jan 22nd, 2020, 04:44 PM
#11
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by npac4o
the code above doesn't break Group.Footer, in my case the Footer works only when SubsetLink is set, otherwise, the IDE crashes. It's the same with Standard EXE Version sample.
Code:
With .Groups.Add(, , "Header Title")
'.SubsetLink = "Subset Link?"
.Footer = "Footer Title"
.FooterAlignment = LvwGroupFooterAlignmentCenter
End With
Interesting. However, it applies only when the ListView1.GroupSubsetCount is > 0. (feature is enabled)
I don't know how to solve it, seems like a comctl32.dll bug.
But, you can workaround it by going way 1 or way 2:
Way1:
Code:
With .Groups.Add(, , "Header Title")
.SubsetLink = "" ' StrPtr <> 0
.Footer = "Footer Title"
.FooterAlignment = LvwGroupFooterAlignmentCenter
End With
Way2: (can be done of course already at design time. A new ListView has GroupSubsetCount = 0 by default)
Code:
ListView1.GroupSubsetCount = 0
 Originally Posted by Semke
Hi!
I am looking at the Checkbox ownerdraw event, could you please give a description of the paramaters
OwnerDraw(ByVal Action As Long, ByVal State As Long, ByVal hDC As Long, ByVal Left As Long, ByVal Top As Long, ByVal Right As Long, ByVal Bottom As Long)
Certain members of the DRAWITEMSTRUCT are passed to the OwnerDraw event.
Code:
typedef struct tagDRAWITEMSTRUCT {
UINT CtlType;
UINT CtlID;
UINT itemID;
UINT itemAction;
UINT itemState;
HWND hwndItem;
HDC hDC;
RECT rcItem;
ULONG_PTR itemData;
} DRAWITEMSTRUCT, *PDRAWITEMSTRUCT, *LPDRAWITEMSTRUCT;
itemAction -> Action
itemState -> State
hDC -> hDC
rcItem -> Left, Top, Right, Bottom
You may find plenty of examples on the net about subclassing a checkbox and handling WM_DRAWITEM.
So just look at those snippets and implement them accordingly into the OwnerDraw event.
Last edited by Krool; Jan 22nd, 2020 at 04:55 PM.
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
|