Avatar of KzKrew
KzKrew
Flag for United States of America asked on

VB.Net ListView Grouping Font Size / Font Bold

I am using the following sub in VB.Net to group data in a Windows Forms ListView.

Passing the data to sub from MySql query. I have been able to group the data by Employee Number - Name as shown in the image below:

My question is How to Make the header stand out more. 

The first header 474 Blake, Jorge font is Too small -- have not been able to figure out how to make bigger or possibly Bold it. I have tried making the text size within the ListView object bigger but has no effect on the grouping text size.

Let me know how to resolve

Thanks  - Dan



    Public Sub GroupByEmpNo(ByVal lstV As System.Windows.Forms.ListView, ByVal SubItemIndex As Int16)
        Dim flag As Boolean = True
        For Each l As ListViewItem In lstV.Items             Dim strmyGroupname As String = l.SubItems(SubItemIndex).Text             For Each lvg As ListViewGroup In lstV.Groups                 If lvg.Name = strmyGroupname Then                     l.Group = lvg                     flag = False                 End If             Next             If flag = True Then                 Dim lstGrp As New ListViewGroup(strmyGroupname, strmyGroupname)                 lstV.Groups.Add(lstGrp)                 l.Group = lstGrp             End If             flag = True         Next     End Sub

Open in new window




Visual Basic.NET

Avatar of undefined
Last Comment
KzKrew

8/22/2022 - Mon
Kelvin McDaniel

Depending upon what Windows Desktop version your executable is targeting, you might be able to do this with Visual Styles. I say "might" because I'm not intimately familiar with this functionality. I was able to dig up the following reference that might point you in the right direction:

VisualStyleElement.ListView.Group Class

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.visualstyles.visualstyleelement.listview.group?view=windowsdesktop-5.0

Good luck!
KzKrew

ASKER
Yes -- i did see that one but focus is C#
Does anyone have a VB.Net solution
Dan
Kelvin McDaniel

You can change the selected language from C# to VB as shown below.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
KzKrew

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.