Setting an individual node in a tree view to have strikeout.

M

Mufasa

How can I set the text for a specific node to be strikeout? It's there but
it's read only.

TIA - Jeff.
 
H

Herfried K. Wagner [MVP]

Mufasa said:
How can I set the text for a specific node to be strikeout? It's there but
it's read only.

Dim f As New Font( _
Me.TreeView1.Font, _
Me.TreeView1.Font.Style Or FontStyle.Strikeout _
)
For i As Integer = 1 To 10
Dim tn As New TreeNode()
tn.Text = "Item " & i
If i Mod 2 = 0 Then
tn.NodeFont = f
End If
Me.TreeView1.Nodes.Add(tn)
Next i
///
 
P

Poonam Sharma

Herfried,

use the following syntax:
Dim f As Font = New Font(Me.treeView1.Font.FontFamily, 12,
FontStyle.Strikeout)
treeView1.Nodes(1).NodeFont = f
 
P

Poonam Sharma

Mufasa,
syntax is:

Dim f As Font = New Font(Me.treeView1.Font.FontFamily, 12,
FontStyle.Strikeout)
treeView1.Nodes(1).NodeFont = f
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top