473,473 Members | 1,723 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Make Treeview Node Font Bold

Ben
Hi

I am having problems making a single node's Font Bold.

objUserTree.Nodes.Item(i)
I am looping though the items but with every property I try it fails.

Thanks
B
Feb 18 '07 #1
2 19615
The return value of ....Item(i) is a TreeViewNode. That object does not
have a font property. I think if you want to make them visually different
you could use the Backcolour / ForeColor or make the control a userpaint
DrawMode = OwnerDrawText . I have not tried the latter but I am sure you
can find examples on the web.

Lloyd Sheen

"Ben" <Be*@Newsgroups.microsoft.comwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
Hi

I am having problems making a single node's Font Bold.

objUserTree.Nodes.Item(i)
I am looping though the items but with every property I try it fails.

Thanks
B
Feb 18 '07 #2
Ben wrote:
I am having problems making a single node's Font Bold.
The TreeNode class sports a NodeFont property (of Type [Font]), but you
can't set individual properties on it; you have to create a whole new
Font object and replace the existing one, as in :

With objUserTree.Nodes.Item(i)
.NodeFont = New Font( .NodeFont, FontStyle.Bold )
End With

You might want to build this "boldFont" object [once] and store it
somewhere, rather than recreating it every time you want to make a Node
bold.

HTH,
Phill W.
Feb 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: timtos | last post by:
I am working on a custom treeView and have some problems with a) node.Bounds.Width b) concatenate strings drawn with DrawString(...) a) I want to highlight a selected node and used the...
0
by: Devhead | last post by:
I changed the treeview node text to bold and changed color "successfully". However, the node text was truncated and when i did a tree refresh the node formatting was gone. What do i need to do to...
6
by: Tim | last post by:
Hi I have a form with a treeview on it. When I select a particular node it adds/shows a tab on the form. The treeview node remains selected as it should. The user can close the tab or remove the...
1
by: Steve Shanks | last post by:
Hi Al Is there away to show specific treeview nodes in BOLD when building the treeview up in code Thank Steve
3
by: barbara_dave | last post by:
Hi all, I like to dispaly treeview node text with several columns as window explorer does and put buttons on the top. When I click a button, the nodes text can be sorted by date, file size,...
3
by: Marcel Brekelmans | last post by:
Hi, When I set the text of a TreeView node to bold (or Italic for that matter) programmatically, it doesn't show up with its length adjusted. Instead, it has the length of the text in normal...
0
by: Tor Inge Rislaa | last post by:
I need a way to control the font apperance of the individual treeview node. Is this possible. TIRislaa
1
by: R.A.F. | last post by:
Hi, I would like simulate a mouse click on on of my treeview nodes when my form opens. for that i was thinking to use the same simple way as under C++ : SendMessage(TreeView.Nodes.Handle,...
5
by: Max2006 | last post by:
Hi, I have a TreeView and this is my node style: <asp:TreeNodeStyle ForeColor = "#000000" Font-Size="9px" Font-Bold="false" Width="100px" NodeSpacing="3px" /> The problem is the expand...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.