{"id":86,"date":"2007-05-12T13:47:19","date_gmt":"2007-05-12T11:47:19","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/add-icons-to-fnplistbox\/"},"modified":"2007-05-12T13:47:22","modified_gmt":"2007-05-12T11:47:22","slug":"add-icons-to-fnplistbox","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/add-icons-to-fnplistbox\/","title":{"rendered":"Add Icons to FNPListBox"},"content":{"rendered":"<p>[code lang=&#8221;delphi&#8221;]procedure TForm1.FnpListBox1DrawCell(Sender: TObject; Index, Col: Integer;<br \/>\n  Rect: TRect; State: TOwnerDrawState);<br \/>\n  Var<br \/>\n   intIcon : Integer;<br \/>\n   TheName : String;<br \/>\n   NewBitmap : TBitmap;<br \/>\nbegin<br \/>\n  If Col = 0 Then<br \/>\n   Begin<br \/>\n   NewBitmap := TBitmap.Create;<br \/>\n    TheName := Copy(FnpListBox1.Items.Strings[Index], 1, Pos(#9, FnpListBox1.Items.Strings[Index]) &#8211; 1);<br \/>\n     intIcon := GetIconIndex(TheName, FILE_ATTRIBUTE_NORMAL);<br \/>\n      Smalls1.GetBitmap(intIcon, NewBitmap);<br \/>\n     with FnpListBox1.Canvas do<br \/>\n      begin<br \/>\n        FillRect(Rect);<br \/>\n        Draw(Rect.Left -1, Rect.Top + 0, NewBitmap);<br \/>\n        TextOut(Rect.Left + 2 + NewBitmap.Width, Rect.Top + 2,<br \/>\n        TheName);<br \/>\n      end;<br \/>\n      NewBitmap.Free;<br \/>\n   End;[\/code]<\/p>\n<p>[tags]Delphi, Components, ListBox[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[code lang=&#8221;delphi&#8221;]procedure TForm1.FnpListBox1DrawCell(Sender: TObject; Index, Col: Integer; Rect: TRect; State: TOwnerDrawState); Var intIcon : Integer; TheName : String; NewBitmap : TBitmap; begin If&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[90,75,91],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-1o","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/86"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}