Jump to content

bold font in listview


sandin
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...