0

Hello everyone,

was looking to see what was availble in listview1.columns.add....
and found this

 ListView1.Columns.Add("ID", FontDialog, HorizontalAlignment.Center)

how would i use this to change the font in listview columns.?
the rest of the code...

      ListView1.Columns.Add("Weekday", 100, HorizontalAlignment.Left)
        ListView1.Columns.Add("Fuel Date", 80, HorizontalAlignment.Left)
        ListView1.Columns.Add("Fuel Time", 80, HorizontalAlignment.Left)
        ListView1.Columns.Add("Location", 60, HorizontalAlignment.Left)
        ListView1.Columns.Add("Pump", 50, HorizontalAlignment.Center)
        ListView1.Columns.Add("Total Liters", 80, HorizontalAlignment.Left)
        ListView1.Columns.Add("Total Dollars", 80, HorizontalAlignment.Left)

Thanks for reading. :-)

2
Contributors
1
Reply
10
Views
1 Year
Discussion Span
Last Post by djjeavons
0

Hi

I haven't seen that constructor before when adding columns and did a check and still can't see it. Can you provide a screen shot or more info on this?

In terms of using a Font however, you can apply a Font style when adding items to the ListView. For example:

Dim fd As New FontDialog
Dim newFont As Font

If fd.ShowDialog = Windows.Forms.DialogResult.OK Then newFont = fd.Font

For i As Integer = 1 To 10
    ListView1.Items.Add("Value " & i.ToString).Font = newFont
Next

HTH

Edited by djjeavons

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.