Is it possible to change the font size of a selected item in TListBox?

Hello!
Anybody here knows that a selected item font size in TListBox can be resized? Please state sample code.

Thanks,

Edwin
0
Edwin
11/30/2009 12:55:21 PM
embarcadero.delphi.vcl.using 2297 articles. 1 followers. Follow

2 Replies
613 Views

Similar Articles

[PageSpeed] 7

"Edwin Aceron" wrote in message news:188264@forums.codegear.com...
> Hello!
> Anybody here knows that a selected item font size in TListBox can be 
> resized? Please state sample code.
>
> Thanks,
>
> Edwin

Use OwnerDraw

David
0
David
11/30/2009 2:21:01 PM
Example - makes alternate lines a different colour (like computer paper!) 
and filters the text before display.  You could set lb.Canvas.Font 
according to your needs.

procedure TFormPassList.ListBoxPassesDrawItem (Control: TWinControl;
  Index: Integer; Rect: TRect; State: TOwnerDrawState);
var
  lb: TListBox;
  st: string;
begin
  if not (Control is TListBox) then Exit;
  lb := Control as TListBox;

  with lb.Canvas do   // Draw on the control's canvas
    begin
    if true_colour and odd (index) and (not (odSelected in State))
    then
      begin
      Brush.Color := alt_window_colour;
      FillRect (Rect);   // Clear the rectangle
      end
    else
      FillRect (Rect);   // Clear the rectangle

    // Display the text
    st := lb.Items [Index];
    Delete (st, 1, 4);             // Remove the 4-digit year field
    st := Copy (st, 1, 2) + DateSeparator + Copy (st, 3, 2) + ' ' +
          Copy (st, 5, 2) + TimeSeparator + Copy (st, 7, 2) + 
TimeSeparator + Copy (st, 9, 2) +
          Copy (st, 11, 999);

    TextOut (Rect.Left + 2, Rect.Top + 1, st);
    end;
end;
0
David
11/30/2009 2:24:44 PM
Reply:

Similar Artilces:

I am using list box when ever i select an item corresponding item desc should display in textbox below fothat i am using list_selected index changed
I am using list box when ever i select an item corresponding item desc should display in textbox below fothat i am using list_selected index changed but if i am using that i am unable to use the Up down Keys to go up an d down using key board can any one help me   thanks vissu  Viswanath"Mark as Answer" if it helps. Hi , Try this: Code ASPX page: <asp:ListBox ID="ListBox1" runat="server"></asp:ListBox> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <script language="javascri...

superreview granted: [Bug 230173] Mozilla use 15 point size font for characters with style {font-size:14px;} : [Attachment 138463] use float type for mPointSize
Christopher Blizzard <blizzard@mozilla.org> has granted Christopher Blizzard <blizzard@mozilla.org>'s request for superreview: Bug 230173: Mozilla use 15 point size font for characters with style {font-size:14px;} http://bugzilla.mozilla.org/show_bug.cgi?id=230173 Attachment 138463: use float type for mPointSize http://bugzilla.mozilla.org/attachment.cgi?id=138463&action=edit ...

How to change tree view's (web control) back color, font color and font size using CSS (Cascading Style Shteets)
Hi All, I have created tree view (web control) but i want to change all the properties of it, through single style sheet. Like all other controls (label, text box and combo box) it's not possible to change all the properties of treeview through single style sheet by including it to the contol ???? Please help........ MAITRAY. Sorry. No external css. but these attributes: DefaultStyle="background:#CCCCCC;border:solid 1px;color:black;font-size:8pt" HoverStyle="color:blue;font-name:Arial" SelectedStyle="c...

superreview granted: [Bug 120401] Font selection in pref. does not work (Hebrew, Arabic, CE, Baltic, Cyrillic, CJK, etc) : [Attachment 155201] Add change to default font size (as in bug 143557)
Simon Fraser <sfraser@aol.net> has granted Asaf Romano <bugs.mano@mail-central.com>'s request for superreview: Bug 120401: Font selection in pref. does not work (Hebrew, Arabic, CE, Baltic, Cyrillic, CJK, etc) http://bugzilla.mozilla.org/show_bug.cgi?id=120401 Attachment 155201: Add change to default font size (as in bug 143557) http://bugzilla.mozilla.org/attachment.cgi?id=155201&action=edit ...

superreview requested: [Bug 120401] Font selection in pref. does not work (Hebrew, Arabic, CE, Baltic, Cyrillic, CJK, etc) : [Attachment 155201] Add change to default font size (as in bug 143557)
Asaf Romano <bugs.mano@mail-central.com> has asked Simon Fraser <sfraser@aol.net> for superreview: Bug 120401: Font selection in pref. does not work (Hebrew, Arabic, CE, Baltic, Cyrillic, CJK, etc) http://bugzilla.mozilla.org/show_bug.cgi?id=120401 Attachment 155201: Add change to default font size (as in bug 143557) http://bugzilla.mozilla.org/attachment.cgi?id=155201&action=edit ------- Additional Comments from Asaf Romano <bugs.mano@mail-central.com> Requsting r/sr for this. I will add some comments here later. ...

How to change font size and color of selected linkbutton.
I built a very simple slideshow app in asp.net. I have a list of linkbuttons in a repeater control. When you click one of the links it loads a specific photo in the slideshow.How can I accent or highlight (change the font size and color) the selected linkbutton (link or photonumber).Thank you for any response, it is appreciated!John BrockThis is my current code below:<%@ Page Language="vb" Debug="true" %><script language="vb" runat="server">Dim iPhotoNumber  As IntegerDim iMaxPhotoNumber As IntegerDim sTheSlide     As StringSub Page_Load(ByVal Sender As O...

Changing font size of FireMonkey TStringGrid
I have a tStringGrid displayed on sample IOS app using XE4 but cannot find anyway to change the font size which is tiny by default and just about unreadable. Anyone know how this font size, type etc can be set? The tStringGrid control is really unusable unless it can be changed. Thanks > {quote:title=Matthew Shallvey wrote:}{quote} > I have a tStringGrid displayed on sample IOS app using XE4 but cannot find anyway to change the font size which is tiny by default and just about unreadable. Join the queue. My preferred method would be to create a custom style for TTextCell, ...

changing default font size does not affect font size on form buttons and input fields.
Hello, in https://bugzilla.mozilla.org/show_bug.cgi?id=305109 I propose that changing the default font size in Preferences should also change the font sizes for form controls. On windows it works this way. Concerning Unix, though, the form controls keep their size, even if you adjust the default font size in Firefox preferences. This makes for ugly form controls if you do not adjust your GTK settings along with your Firefox default font size. But there is a workaround: you can also make Firefox scale the form controls by applying the following changes to 'font:' li...

asp:menu
I've created a basic ASP:menu, but want to change the font color of the item relative to the current page. Eg: If I select 'home', I am transferred to 'Default.aspx' and I want the 'home' link to appear in a different color. Any help would be appreciated! <asp:Menu ID="Menu1" runat="server" Font-Names="Verdana" Font-Size="9pt" ForeColor="#003399" Orientation="Horizontal" StaticSubMenuIndent="10px" style="left: 40px; position: relative; top: 6px" StaticEnableDefaultPopOutImage="...

Change font size for a single item in context menu?
The vast majority of my web browsing consists of right clicking on a link a= nd picking "Open Link in New Tab", and it would be nice to have menu option= displayed with a larger font size so it's easier to select. From another = site, I found this which changes the font size for all context menus and co= ntext menu items. Is it possible to just have this affect a single menu it= em? =20 (userChrome.css) #contentAreaContextMenu menuitem, #contentAreaContextMenu menu { -moz-appearance: none !important; font-size: 24pt !important; } On 12-08-07 3:23 PM, craigsl...

how to change the color of the selected item of drop downlist using javascript?
 Hi, how to change the color of the selected item of drop downlist using javascript? Please help me. I might be wrong but i dont think we can apply styles to individual items in asp dropdownlists.....you might find some custom dropdownlists over the web which do that... here is a link which can get you started... http://www.codeproject.com/KB/custom-controls/csMultiColorDropDownList.aspx?display=PrintAll  the other option would be to use a HTML dropdownlist through which you can apply style to individual items.. http://www.syncfusion.com/faq/aspnet/web_c6c.asp...

Sunbird needs capability to change the font size of text items.
Name: Robert Ziegler Email: bobdotbziegleratgmaildotcom Product: Firefox Summary: Sunbird needs capability to change the font size of text items. Comments: Sunbird needs the capability to redice the size of text in events to allow printing a month calendar on a single page when there are many events. Obviously there must be a limit to how small the text can be made and still be readable, like 6 pt. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 ...

superreview requested: [Bug 79069] Enter key should only go to selected autocomplete item if keyboard was used to select item
neil@parkwaycc.co.uk <neil@httl.net> has asked jag (Peter Annema) <jag@tty.nl> for superreview: Bug 79069: Enter key should only go to selected autocomplete item if keyboard was used to select item https://bugzilla.mozilla.org/show_bug.cgi?id=79069 Attachment 274692: Typing should deselect search engine https://bugzilla.mozilla.org/attachment.cgi?id=274692&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil@httl.net> This patch fixes the regression from the satchel changes. As it's not easy to override the selectedIndex setter I have i...

[D2010] changing default font/size for vcl's
the default font is tahoma,8 but i'd like to change it i tried to add default in the form design in the registrty like old delphis' but it wasnt working. i tried to add in Hkey_CurrentUser/software/codegear/bds/6.0/... and 7.0/ and etm/12.0 etm/14.0, none of those wroks i add a string value DefaultFont : Arial,12 into those, but its still using tahoma . thanks in advance yao-wei chu wrote: > the default font is tahoma,8 but i'd like to change it > > i tried to add default in the form design in the registrty like old > delphis' but it w...

Web resources about - Is it possible to change the font size of a selected item in TListBox? - embarcadero.delphi.vcl.using

Accessibility Functionality Add On For Delphi XE6 Firemonkey On Windows And IOS
Fernando Rizzato from Embarcadero has a blog post up with a pretty big add on for Delphi XE6 Firemonkey. The add on is Accessibility functionality ...

Get The Accessibility Support Pack For Delphi XE8 Firemonkey On Windows And Mac OSX
Embarcadero has released a free accessibility pack for Delphi XE8 Firemonkey on Windows and Mac OSX. The accessibility pack brings screen reader ...

Free Accessibility Support Pack For Delphi XE7 Firemonkey On Windows And Mac OSX
Embarcadero has released a free Accessibility pack for Delphi XE7 Firemonkey for Windows and Mac OSX. The accessibility pack brings screen reader ...

Resources last updated: 12/22/2015 8:04:00 AM