Jump to content
Sign in to follow this  
sandin

bold font in listview

Recommended Posts

sandin

I have found this on forum:

Case $NM_CUSTOMDRAW
                    Local $tCustDraw = DllStructCreate('hwnd hwndFrom;int idFrom;int code;' & _
                                        'dword DrawStage;hwnd hdc;long rect[4];dword ItemSpec;int ItemState;dword Itemlparam;' & _
                                        'dword clrText;dword clrTextBk;int SubItem;' & _
                                        'dword ItemType;dword clrFace;int IconEffect;int IconPhase;int PartID;int StateID;long rectText[4];int Align', _ ;winxp or later
                                        $lParam)
                   
                    Local $iDrawStage = DllStructGetData($tCustDraw, 'DrawStage')
                   
                    If $iDrawStage = $CDDS_PREPAINT Then Return $CDRF_NOTIFYITEMDRAW
                   
                    Local $iItem = DllStructGetData($tCustDraw, 'ItemSpec')
                   
                    Switch $iItem
                        Case 5
                            DllStructSetData($tCustDraw, 'clrText', 0x5555DD)
                            Local $hDC = DllStructGetData($tCustDraw, "hdc")
                            _WinAPI_SelectObject($hDC, $Font)
                            Return $CDRF_NEWFONT
                    EndSwitch

but if copy/paste code from above and change "case 5" to some other item number, it doesn't become bolded.

thank you.

Edited by sandin

Share this post


Link to post
Share on other sites
ProgAndy

Well, you could set the item as drophilited in DBLClick:

_GUICtrlListView_SetItemDropHilited

and then check for the Drophilite state when drawing it. DropHilited Item-> Bold otherwise not.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.