LISTBOX bold font not work...

User avatar
sal21
PlatinumLounger
Posts: 4576
Joined: 26 Apr 2010, 17:36

LISTBOX bold font not work...

Post by sal21 »

Part of my code:

Code: Select all

With Me.List1

'...

 .Clear
        .AddItem ""
        .Font.Bold = True
        .AddItem PadC("SCHEDA ATLETA", LARGHEZZA)
        .Font.Bold = False
        .AddItem ""
'...

And With'
this cdoe dont show in bold this line .AddItem PadC("SCHEDA ATLETA", LARGHEZZA)

User avatar
HansV
Administrator
Posts: 80088
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: LISTBOX bold font not work...

Post by HansV »

VB6 itself does not let you make a listbox item bold. You'd have to use a lot of Windows API functions. Using a ListView or FlexGrid control might be easier.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4576
Joined: 26 Apr 2010, 17:36

Re: LISTBOX bold font not work...

Post by sal21 »

:thankyou:
HansV wrote:
12 Jan 2025, 17:09
VB6 itself does not let you make a listbox item bold. You'd have to use a lot of Windows API functions. Using a ListView or FlexGrid control might be easier.
:thankyou:

snb
5StarLounger
Posts: 678
Joined: 14 Nov 2012, 16:06

Re: LISTBOX bold font not work...

Post by snb »

Ever heard of e.g. font: Arial Rounded MT Bold ???

User avatar
HansV
Administrator
Posts: 80088
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: LISTBOX bold font not work...

Post by HansV »

Would that make a single listbox item bold?
Best wishes,
Hans

snb
5StarLounger
Posts: 678
Joined: 14 Nov 2012, 16:06

Re: LISTBOX bold font not work...

Post by snb »

Even more than a single item.....

User avatar
HansV
Administrator
Posts: 80088
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: LISTBOX bold font not work...

Post by HansV »

If I understood Sal21's question correctly, he wants to make a single item bold while the rest is not bold. I don't know of a way to do that except by subclassing and custom drawing the list box.
Best wishes,
Hans

snb
5StarLounger
Posts: 678
Joined: 14 Nov 2012, 16:06

Re: LISTBOX bold font not work...

Post by snb »

I think you see this right. But I don't see any sensible purpose to do so.