Questions tagged [custom-draw]
67 questions
1
vote
0 answers
Best way to use custom (sub)item draw when writting a Win32 ListView derived custom window class
The normal way to implement custom (sub)item draw in listview is to handle the NM_CUSTOMDRAW notification in the parent class, and do the drawing there.
However I am writing a reusable listview derived window class and would like to avoid having to…

H. Arlinghaus
- 69
- 5
1
vote
2 answers
MFC CListCtrl CustomDraw() event handler code getting stuck
I'm currently experiencing a problem with my OnNMCustomdrawlistctrlvalues() event handler being called non-stop once I've painted a CListCtrl row red (code gets stuck), causing my application to freeze once I try to perform another event, such as…

LKB
- 1,020
- 5
- 22
- 46
1
vote
1 answer
How to change item size and gap between them in Custom Drown CListCtrl
As far as I know ON_WM_MEASUREITEM does not get called in Custom Draw list control. It is only used if control is Owner Drawn.
I have found a way to do that, but it is somewhat a HACK and I still can not control gaps between items they are set up…

Ma99uS
- 10,605
- 8
- 32
- 42
1
vote
1 answer
Custom drawing of icons in CToolbar customization dialog
I am trying to customize CToolbar class(MFC library) for my needs (enabling support of 32 bit icons with anti-aliasing).
For that purpose I am using custom draw method provided by CToolbar, where I paint my own Icons.
Icons are rendered fine and…

spin_eight
- 3,925
- 10
- 39
- 61
1
vote
1 answer
Disable or greyout rows in CListCtrl Customdraw function
I have a CListCtrl in a MFC dialog. What I have to do is disbling some the items based on a condition so that user can't select that.Till now I have changed the colour but thats not proper a solution. My code looks like this:
void…

Codename_DJ
- 553
- 1
- 11
- 40
1
vote
2 answers
Winapi : Change Color of a TreeView using CustomDraw
I am currently trying to change the background color of a TreeView item.
Therefore, I am using this message to create the item:
SendMessage(ListView, LVM_INSERTITEM, 0, (LPARAM)&lvI);
Additionally, I am handling the custom draw message like…

Henry
- 727
- 1
- 6
- 25
1
vote
0 answers
CustomDraw remains in PrePaint drawstage
I am facing some troubles when processing the NM_CUSTOMDRAW message on 64 bit machines. We have an CListCtrl derived class with a CHeaderCtrl derived header (linked via PreSubclassWindow).
In the CHeader derived class we do some custom painting.…

user1202648
- 41
- 4
1
vote
1 answer
MS Header control still draws border for custom-drawn items
We are developing a custom grid control in VB6 (still need to use the classic VB - sorry :). It has a custom header based on the standard OS MS Header Control from ComCtl created using the corresponding WinAPI call to CreateWindowEx. The header…

TecMan
- 2,743
- 2
- 30
- 64
1
vote
1 answer
TListView - when mouse is over an item, do not draw that blue rectangle. How?
When mouse moves above TListView items, there's that blue outline (see picture). How would I remove it?
The only way I know is to do all the item drawing manually... But maybe there's an easier way? Tried HotTrack=False, doesn't help :(

djsoft
- 1,051
- 8
- 19
1
vote
2 answers
Get Column ID in NMLVCUSTOMDRAW C++
I need to get the column id will be drawn. This is my some of my code
I try to get item id and column id to use ListView_GetItemText and set the correct color of the item to be drawn.
switch( ((LPNMLVCUSTOMDRAW)lParam)->nmcd.dwDrawStage){
case…

Phat Tran
- 307
- 1
- 3
- 14
0
votes
0 answers
How do you update all the TreeView items full area when the vertical scrollbar shows up or goes away?
I am using NM_CUSTOMDRAW to draw tree view items. My items right justify parts of it by using a right margin based on the RECT area reported available. The issue I have is that when the vertical scrollbar appears or disappears, only the item…

user3161924
- 1,849
- 18
- 33
0
votes
0 answers
CDialogEx:: OnNCPaint() increases the size of dialog window
I need to draw custom title bar, using Win10, VS2017, MFC, SDK10.0.16299.0.
When MyDialog::OnNcPaint() does not call CDialogEx::OnNcPaint(), the dialog frame is drawn incorrectly - the top corners are rounded while bottom corners are sharp, and…

Robert Zak
- 1
- 2
0
votes
0 answers
Measure ToolStripItem in custom ToolStrip renderer
I have a WinForms app for .NET Framework in which the text of items in context menus based on the the ContextMenuStrip component are drawn using Graphics.DrawString() to provide consistent look with other interface elements. The core part of the…

TecMan
- 2,743
- 2
- 30
- 64
0
votes
0 answers
How to make TreeView send CDDS_*ERASE events?
I'm implementing a customized TreeView with win32. Have the following custom draw code:
void treeCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
NMCUSTOMDRAW* pNMCustomDraw = (NMCUSTOMDRAW*)pNMHDR;
NMTVCUSTOMDRAW* pNMTVCustomDraw =…

snuk182
- 1,022
- 1
- 12
- 28
0
votes
0 answers
How is a tooltip custom-drawn if it's always a popup?
The tooltip docs say that
A tooltip control always has the WS_POPUP and WS_EX_TOOLWINDOW window
styles, regardless of whether you specify them when creating the
control.
Meanwhile, the way to custom draw a tooltip is through…
user15284017