473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How do you make one line bold in a TreeView Class in WPF/C#?

complete
How do you make one line bold in a TreeView Class in WPF/C#?

I mean, how do you make just one line in a Tree View bold at runtime?
Jun 1 '10 #1
2 2253
GaryTexmo
1,501 Expert 1GB
I don't know about WPF, but in C# I don't think you can... at least not with the control as is. Were it WinForms you'd need to create a new class that inherited from TreeView and override the paint event. If there's a property for UserDraw, you'd also have to set that.

If it is WPF you're working with, I did a quick google search and there's quite a few articles for making a TreeView in WPF. Perhaps those will get you on the right track to building your own, then you can set whichever line you need bolded on your own.

Good luck!
Jun 1 '10 #2
ThatThatGuy
449 Expert 256MB
@complete
I don't know what do you meant by that.
But i suppose you are trying to do is change the current UI of the Tree View Control..

In that case you need to create the Whole UI of Tree View
by Setting the TreeView Template
Something under this Markup
Expand|Select|Wrap|Line Numbers
  1. <TreeView.Template>
  2. <ControlTemplate>
  3. <!-- Code for The Template-->
  4. </ControlTemplate>
  5. </TreeView.Template>
  6.  
This link below will give a good start at what should be done

http://www.codeproject.com/KB/WPF/Ad...eeViewLyt.aspx
Jun 1 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Arne | last post by:
Hi, I would like to have a OL list, that is "ordinary" in other aspect except this: Since every <LI> will have more than 2 lines of text, I like to make the first line bold (kind of sub header...
2
by: Peter Flickinger | last post by:
I have been using a label with the TreeView control - to simulate the ghost image of a node during drag/drop (so that a ghost of the node appears to be floating next to the cursor on a drag/drop)....
2
by: Coralin Feierbach | last post by:
I created a Windows Form Project using VS.net. I'm trying to draw a line between two points. (Plotting a graph, dynamically) This is the code I have so far: What do I have to do to actually see...
8
by: Hrvoje Voda | last post by:
What is wrong in this code? private void tree_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.Enter ) {
3
by: Kiran A K | last post by:
hi, when i use the "System.Windows.Forms.TreeView" class, the first node gets selected by default. i don't want this default behavior. i don't wany any node to be selected when the "TreeView"...
9
by: Jason | last post by:
If I've got Me.RichTextBox1.Text = "In Ricn Tex Box" Me.RichTextBox1.Text &= "Line two" & vbCrLf How do I make the first line appear BOLD?
6
by: cyriel1920 | last post by:
Hi, I use the selectednodestyle with a white background so the user can see which item was chosen in the treeview navigation. The nodes have a navigateURL with a target to another frame....
0
by: coosa | last post by:
Dear all, I have been exploring a bit about the TreeView Class in Windows Forms and see that there is no XML Datasource binding. I checked then the BindingsSource Class and say it can be only...
4
by: kdsutaia | last post by:
hi! I am trying to read file line by line using BufferReader class.Following I have written to read but some how for few of the file it is not reading the whole file. Can any help me to resolve this...
3
by: theS70RM | last post by:
Hey, This is probably just a question of syntax but i cant figure it out! i have a javascript class with several functions, one being something like ... TreeView.prototype.showItems =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.