StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
WinForms (How do I?)
»
How to change listview items fonts?
How to change listview items fonts?
Post Reply
Like
0
How to change listview items fonts?
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Edhy Rijo
E
Edhy Rijo
posted 15 Years Ago
ANSWER
Topic Details
Share Topic
E
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
I have a SF listview and want to change the font for its items, I though that by changing the font in the listview will take care of that, but nope, it will only change the font for the columns.
Then I try in the OnLoad with the following code:
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
'-- Change the font of the listview items
For Each item As ListViewItem In Me.lstItemsStock.Items
item.Font = New System.Drawing.Font("Segoe UI", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Next
End Sub
That did not work either, so here is the question: How to change the font for the ListViewItems in the SF ListView?
Edhy Rijo
Reply
Like
0
Edhy Rijo
E
Edhy Rijo
posted 15 Years Ago
ANSWER
Post Details
Share Post
E
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
Never mind, I found it after looking at the obvious for other settings in the ListView "RowPopulated" event.
Here is the code...
Dim myListViewItemFont As Object = New System.Drawing.Font("Segoe UI", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Private Sub lstItemsStock_RowPopulated(ByVal sender As System.Object, ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatedEventArgs) Handles lstItemsStock.RowPopulated
e.ListViewItem.Font = myListViewItemFont
End Sub
Edhy Rijo
Reply
Like
0
Trent Taylor
Trent Taylor
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
Yup, that was the very reason that we added that method, to expose the entire list item so you can do whatever necessary. Good find
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search