Click here to Skip to main content
16,004,882 members
Home / Discussions / C#
   

C#

 
GeneralRe: Nullables in type parameters? Pin
Dominik Reichl18-Oct-06 5:11
Dominik Reichl18-Oct-06 5:11 
AnswerRe: Nullables in type parameters? Pin
Colin Angus Mackay18-Oct-06 4:39
Colin Angus Mackay18-Oct-06 4:39 
GeneralRe: Nullables in type parameters? Pin
Dominik Reichl18-Oct-06 5:09
Dominik Reichl18-Oct-06 5:09 
GeneralRe: Nullables in type parameters? Pin
Christian Graus18-Oct-06 8:15
protectorChristian Graus18-Oct-06 8:15 
AnswerRe: Nullables in type parameters? Pin
Vega0219-Oct-06 17:19
Vega0219-Oct-06 17:19 
QuestionMultiple Conditions in DataView.ROWFILTER Pin
PaulaM18-Oct-06 1:51
PaulaM18-Oct-06 1:51 
AnswerRe: Multiple Conditions in DataView.ROWFILTER Pin
Robert Rohde18-Oct-06 2:02
Robert Rohde18-Oct-06 2:02 
Question[Solved]Setting Bold Fonts on Nodes of a TreeView Pin
Sebastian Schneider18-Oct-06 1:51
Sebastian Schneider18-Oct-06 1:51 
Holla,

I am currently for the first time requiring differently marked items in a treeView. Namely, I have a Text-Box in which a search-string is entered. If the search is sent, all items
containing the search-pattern should be marked (by making them display in bold font.

Since the NodeFont property of the nodes is not set (by default, I guess), I am using the treeView's Font as a reference:
<br />
public void markNodes (System.Windows.Forms.TreeNodeCollection nodes)<br />
{<br />
    if (nodes.Count == 0) return;<br />
    foreach(   System.Windows.Forms.TreeNode currNode<br />
               in nodes<br />
           )<br />
    {<br />
        if (currNode.Text.ToLower().IndexOf(tbSearch.Text.ToLower()) >= 0)<br />
        {<br />
          currNode.NodeFont = new Font(tvMain.Font, FontStyle.Bold);<br />
        }<br />
        else <br />
        {<br />
          currNode.NodeFont = new Font(tvMain.Font, FontStyle.Regular);<br />
        }<br />
        markNodes(currNode.Nodes);<br />
    }<br />
}


This recursive method is called first with tvMain.Nodes.

I do get bold fonts with this code, but the Items are truncated, it seems that some rendering-size property is set to the width of the item int its original font, since
parts of the next letter are occasionally visible.

Unfortunately, I cannot find this property. Refreshing the tree-view, however, does not change this behaviour.

Any tips?

Thanks in advance.


-- modified at 8:19 Wednesday 18th October, 2006

Cheers,
Sebastian

--
Contra vim mortem non est medicamen in hortem.

AnswerRe: Setting Bold Fonts on Nodes of a TreeView Pin
Robert Rohde18-Oct-06 2:04
Robert Rohde18-Oct-06 2:04 
GeneralRe: Setting Bold Fonts on Nodes of a TreeView Pin
Sebastian Schneider18-Oct-06 2:06
Sebastian Schneider18-Oct-06 2:06 
Questionmerging files Pin
Yustme18-Oct-06 1:49
Yustme18-Oct-06 1:49 
AnswerRe: merging files Pin
Christian Graus18-Oct-06 2:03
protectorChristian Graus18-Oct-06 2:03 
GeneralRe: merging files Pin
Yustme18-Oct-06 2:16
Yustme18-Oct-06 2:16 
GeneralRe: merging files Pin
Christian Graus18-Oct-06 4:07
protectorChristian Graus18-Oct-06 4:07 
AnswerRe: merging files Pin
Larantz19-Oct-06 12:10
Larantz19-Oct-06 12:10 
Questionhow to insert picture in MS ACCESS table Pin
PavanPareta18-Oct-06 1:32
PavanPareta18-Oct-06 1:32 
AnswerRe: how to insert picture in MS ACCESS table Pin
Christian Graus18-Oct-06 1:33
protectorChristian Graus18-Oct-06 1:33 
Questiontrapping sqlexception Pin
DownBySpj18-Oct-06 1:23
DownBySpj18-Oct-06 1:23 
AnswerRe: trapping sqlexception Pin
Paul Brower18-Oct-06 4:56
Paul Brower18-Oct-06 4:56 
QuestionHow to convert bmp or jpg into DICOM? Pin
Dejan Paunovic18-Oct-06 1:06
Dejan Paunovic18-Oct-06 1:06 
AnswerRe: How to convert bmp or jpg into DICOM? Pin
Christian Graus18-Oct-06 1:30
protectorChristian Graus18-Oct-06 1:30 
QuestionDatagrid and repeater allow paging Pin
iyoko18-Oct-06 0:45
iyoko18-Oct-06 0:45 
AnswerRe: Datagrid and repeater allow paging Pin
bhanu1234518-Oct-06 21:05
bhanu1234518-Oct-06 21:05 
GeneralRe: Datagrid and repeater allow paging Pin
iyoko21-Oct-06 5:34
iyoko21-Oct-06 5:34 
QuestionFtpClientConnection Pin
toink toink18-Oct-06 0:43
toink toink18-Oct-06 0:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.