In TreeView control, If i select parent node which gets bold then i select another parent node which also gets bold. In this case i am able to see which node is selected and which is deselected.
I need code for if i selected another parent node then previously selected node gets deselected and gets normal style means not bold.
- Parent 1
--- Child Node 1
--- Child Node 2
- Parent 2
--- Child Node 3
--- Child Node 4
If Parent 1 is selected(bold) by default when form loads and then if i select Parent 2 then Parent 1 gets normal font and Parent 2 gets bold bcoz it is currently selected.
If I have a TreeView and fill it with nodes and then decide to change one of
the node's font styles to bold, the end of the text in that node gets
chopped off. It seems like the TreeView isn't taking the NodeFont's style
into account when calculating the width of the text. Here's the code to
make it happen on a node named treeNode in a TreeView named treeView:
treeNode.NodeFont = new Font(treeView.Font, FontStyle.Bold);
I spotted this a few weeks ago when somebody asked how to make nodes bold... the suggestion then was to place a few spaces at the end of the text of the node, this will not be visible but will mean that there is enough space assigned to display the same text in bold.
If I remember right it should work to assign a bold Font to the TreeView and initially assign all nodes a normal font. This way the tree calculates the width with the bold font and thus everything fits.
Use XML text writer class to create the following XML file:
<?xml version="1.0" encoding="utf-8"?>
Use the XMLTextReader to read the file created in the Part 1 and display data as shown below:
Hardisk 12 200
Monitor 10 300
I already done Part 1 but i can't done Part 2, I am newbie, Plz Help.
May be long but why dont u put the contents in txt file print that file directly to printer
when u r filling listbox create and write contents to text file also and then u may use a print button to print or whatever u like. I did this and its working fine.
May anyone give you better solution.
Sorry for this idea if you don't like.
Last Visit: 31-Dec-99 18:00 Last Update: 26-Sep-23 22:20