Is it possible to change a listview column header's text to say bold? 
Author Message
 Is it possible to change a listview column header's text to say bold?

Hi All

I'm using VB6 and allowing users to click the column header text of a
listview item to sort it.

What would be nice is if I could change the column header text to say bold
so that the user was aware as to what column had been selected to sort the
entire listview.

Is this possible?

Thanks



Fri, 15 Jul 2011 07:40:26 GMT  
 Is it possible to change a listview column header's text to say bold?
Laphan schrieb:
Quote:
> What would be nice is if I could change the column header text to say bold
> so that the user was aware as to what column had been selected to sort the
> entire listview.

Why not do it the standard way and display a small sort arrow in this
header?

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
berzeugung, dass die demokratischen Kr?fte berwiegen und sich auf
demokratischem Wege durchsetzen."



Fri, 15 Jul 2011 07:45:54 GMT  
 Is it possible to change a listview column header's text to say bold?


Quote:
> Laphan schrieb:
>> What would be nice is if I could change the column header text to say
>> bold
>> so that the user was aware as to what column had been selected to sort
>> the
>> entire listview.
> Why not do it the standard way and display a small sort arrow in this
> header?

> Timo

No, the "Standard way" to show which column it's sorted on is to tint that
column slightly grey, this however only works if you have the XP theme thing
enabled with a manifest, the arrow is used in conjunction to show the sort
order.

Here is how you set the grey column, I've no idea how to show the sort order
mark.

Private Const LVM_FIRST = &H1000
Private Const LVM_SETSELECTEDCOLUMN        As Long = LVM_FIRST + 140

Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA"
(ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam
As Long) As Long

Public Sub SetHiColumn(LVHwnd As Long, ColumnID As Long)
Call SendMessageLong(LVHwnd, LVM_SETSELECTEDCOLUMN, ColumnID, 0)
End Sub

Regards
Dave O.



Fri, 15 Jul 2011 18:26:56 GMT  
 Is it possible to change a listview column header's text to say bold?

Quote:
>> Why not do it the standard way and display a small sort arrow in this
>> header?
> No, the "Standard way" to show which column it's sorted on is to tint that
> column slightly grey, this however only works if you have the XP theme
> thing enabled with a manifest, the arrow is used in conjunction to show
> the sort order.

Then it's not "standard." Standard is the way it's been since Windows 95,
which is the arrow. The shading is new.

And XP themes do not have to be enabled. I run with the "Classic" theme,
which is in fact no theme at all, and I get the shading. A manifest may be
required for a VB program, however; I don't dispute that.



Fri, 15 Jul 2011 22:45:17 GMT  
 Is it possible to change a listview column header's text to say bold?
Jeff Johnson schrieb:
Quote:
> And XP themes do not have to be enabled. I run with the "Classic" theme,
> which is in fact no theme at all, and I get the shading. A manifest may be
> required for a VB program, however; I don't dispute that.

Not only for a VB program, but for any program (modern versions of
Visual C++ do this for you, so it appears as if no manifest is required).
The "Classic" theme in some way *is* a theme. It doesn't use the theming
engine, but you need version 6.0 or newer of comctl32.dll for it. That's
why you need a manifest.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
berzeugung, dass die demokratischen Kr?fte berwiegen und sich auf
demokratischem Wege durchsetzen."



Fri, 15 Jul 2011 23:23:16 GMT  
 Is it possible to change a listview column header's text to say bold?
Dave O. schrieb:
Quote:
> Here is how you set the grey column, I've no idea how to show the sort order
> mark.

This can be done by sending the HDM_SETITEM message to the header
control. The fmt member of the HDITEM struct you're sending with this
message must contain HDF_SORTDOWN or HDF_SORTUP.
However, this requires comctl32.dll 6.0 or newer. For older versions,
you must use a header image to set the sort arrow.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
berzeugung, dass die demokratischen Kr?fte berwiegen und sich auf
demokratischem Wege durchsetzen."



Fri, 15 Jul 2011 23:26:35 GMT  
 Is it possible to change a listview column header's text to say bold?
Sorry to threadjack, but I wanted Timo to see this.

Timo, I've had another look at your controls, and am thinking of giving them
a try again, as I see that Vista styles are now supported. Do you have any
Check or Option box controls (I don't see any), ones that don't have the
problem with being put into a frame, with XP and Vista? Actually, maybe it's
the Frame control itself that is the problem, as it has no Windows handle?

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net



Sat, 16 Jul 2011 00:21:03 GMT  
 Is it possible to change a listview column header's text to say bold?
Rick Raisley schrieb:
Quote:
> Timo, I've had another look at your controls, and am thinking of giving them
> a try again, as I see that Vista styles are now supported. Do you have any
> Check or Option box controls (I don't see any), ones that don't have the
> problem with being put into a frame, with XP and Vista? Actually, maybe it's
> the Frame control itself that is the problem, as it has no Windows handle?

Yes, the Frame control itself is the problem - or better: The biggest
part of the problem.
The ButtonControls lib
(http://www.timosoft-software.de/index.php/downloads/buttoncontrols/)
contains a Frame control, a CheckBox control, an OptionButton control
and a CommandButton control. If I remember correctly, just replacing
VB's Frame control with mine won't be enough to solve all theming
problems. I think you'll need to replace the checkboxes and option
buttons as well.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
berzeugung, dass die demokratischen Kr?fte berwiegen und sich auf
demokratischem Wege durchsetzen."



Sat, 16 Jul 2011 00:30:28 GMT  
 Is it possible to change a listview column header's text to say bold?
I see that now, thank you. You don't have that capability from the Forms 2.0
library where Option boxes can be grouped, do you? So you can have more than
one "group" of option boxes within a container?

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net


Quote:
> Rick Raisley schrieb:
>> Timo, I've had another look at your controls, and am thinking of giving
>> them
>> a try again, as I see that Vista styles are now supported. Do you have
>> any
>> Check or Option box controls (I don't see any), ones that don't have the
>> problem with being put into a frame, with XP and Vista? Actually, maybe
>> it's
>> the Frame control itself that is the problem, as it has no Windows
>> handle?
> Yes, the Frame control itself is the problem - or better: The biggest
> part of the problem.
> The ButtonControls lib
> (http://www.timosoft-software.de/index.php/downloads/buttoncontrols/)
> contains a Frame control, a CheckBox control, an OptionButton control
> and a CommandButton control. If I remember correctly, just replacing
> VB's Frame control with mine won't be enough to solve all theming
> problems. I think you'll need to replace the checkboxes and option
> buttons as well.

> Timo
> --
> www.TimoSoft-Software.de - Unicode controls for VB6
> "Those who sacrifice freedom for safety deserve neither."
> "Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
> berzeugung, dass die demokratischen Kr?fte berwiegen und sich - auf
> demokratischem Wege - durchsetzen."



Sat, 16 Jul 2011 01:33:37 GMT  
 Is it possible to change a listview column header's text to say bold?

No, my option button control supports grouping by container only.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
berzeugung, dass die demokratischen Kr?fte berwiegen und sich auf
demokratischem Wege durchsetzen."



Sat, 16 Jul 2011 01:47:51 GMT  
 Is it possible to change a listview column header's text to say bold?

Quote:
>I see that now, thank you. You don't have that capability from the Forms
>2.0 library where Option boxes can be grouped, do you? So you can have more
>than one "group" of option boxes within a container?

No real need for that. You can simply place a second (or more) set of
buttons in a frame and set the frame's border style = none. No one will know
it's there except you. If you'd rather not use a frame (btw, the XP vs Frame
problem is because of the lack of an hDC property), you can use a picturebox
or usercontrol.

Here's a usercontrol that may help.
http://www.vbsight.com/CodeS.htm#SuperContainer

Hopefully, you're not using any Forms 2.0 controls in your app.



Sat, 16 Jul 2011 05:03:50 GMT  
 Is it possible to change a listview column header's text to say bold?

Quote:


>>I see that now, thank you. You don't have that capability from the Forms
>>2.0 library where Option boxes can be grouped, do you? So you can have
>>more than one "group" of option boxes within a container?

> No real need for that. You can simply place a second (or more) set of
> buttons in a frame and set the frame's border style = none. No one will
> know it's there except you. If you'd rather not use a frame (btw, the XP
> vs Frame problem is because of the lack of an hDC property), you can use a
> picturebox or usercontrol.

Right, I know that, but as Timo's controls are different, I thought perhaps
he may have added that capability.

Quote:
> Here's a usercontrol that may help.
> http://www.vbsight.com/CodeS.htm#SuperContainer

I'm still using a very old VSOCX.ocx, but it works pretty well. Flickers
some, though.

Quote:
> Hopefully, you're not using any Forms 2.0 controls in your app.

No, I learned that lesson many years ago. Before I got into the forums.
Converted an entire, fairly large project to Forms 2.0 because of all the
really neat features, then after having problems, had to convert it all back
again.  :-(

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net



Sat, 16 Jul 2011 05:23:10 GMT  
 Is it possible to change a listview column header's text to say bold?

Quote:

> Right, I know that, but as Timo's controls are different, I thought
> perhaps he may have added that capability.

>> Here's a usercontrol that may help.
>> http://www.vbsight.com/CodeS.htm#SuperContainer

> I'm still using a very old VSOCX.ocx, but it works pretty well. Flickers
> some, though.

Well.. can't argue with "don't fix it, if it ain't broke" <g>

Quote:
>> Hopefully, you're not using any Forms 2.0 controls in your app.

> No, I learned that lesson many years ago. Before I got into the forums.
> Converted an entire, fairly large project to Forms 2.0 because of all the
> really neat features, then after having problems, had to convert it all
> back again.  :-(

Yeah, they're a pain, full of bugs, not designed for VB (they're designed
for and installed along with VBA - access, excel, others) and not legal to
package and ship with an app, so they're fairly worthless. It's far too easy
to browse through your list of components/references, find something
interesting and assume it's Ok to use... especially when Microsoft, who's
supposed to know these things, suggests using them for their Unicode
support! Kinda like dangling a carrot in front of a donkey, eh?


Sat, 16 Jul 2011 15:50:17 GMT  
 Is it possible to change a listview column header's text to say bold?


Quote:


> > Right, I know that, but as Timo's controls are different, I thought
> > perhaps he may have added that capability.

> >> Here's a usercontrol that may help.
> >>http://www.vbsight.com/CodeS.htm#SuperContainer

> > I'm still using a very old VSOCX.ocx, but it works pretty well. Flickers
> > some, though.

> Well.. can't argue with "don't fix it, if it ain't broke" <g>

> >> Hopefully, you're not using any Forms 2.0 controls in your app.

> > No, I learned that lesson many years ago. Before I got into the forums.
> > Converted an entire, fairly large project to Forms 2.0 because of all the
> > really neat features, then after having problems, had to convert it all
> > back again. ?:-(

> Yeah, they're a pain, full of bugs, not designed for VB (they're designed
> for and installed along with VBA - access, excel, others) and not legal to
> package and ship with an app, so they're fairly worthless. It's far too easy
> to browse through your list of components/references, find something
> interesting and assume it's Ok to use... especially when Microsoft, who's
> supposed to know these things, suggests using them for their Unicode
> support! Kinda like dangling a carrot in front of a donkey, eh?

You could check out, http://www.10tec.com/home/index.aspx

I have used their iGrid control instead of listviews, grids etc from
VB6.It has lots more functionality and works so much better. I would
highly recommend.



Sat, 16 Jul 2011 16:07:05 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. ListView control and column headers, change text possible?

2. Is it possible to hide only one Column Header inm a ListView

3. Is it possible to change excel column headers ?

4. How to change color of ListView column header?

5. Change the column header color in ListView

6. Listview find Column Header Text

7. ListView Question; How to get column header text

8. Is it possible to enter a text directly to a ListView (only on a specific column)

9. Change Colour for Listview's Column bar

10. ListView: Column Text becomes Left-Aligned when ColumnHeader Icon is changed in Code

11. ListView: Column Text becomes Left-Aligned when ColumnHeader Icon is changed in Code

12. Controltips text = bold - possible?

 

 
Powered by phpBB® Forum Software