|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Treeview (Eric Moreau)thnks for the help on your site. It's great. In your example you turned the node grey and checked the color. If e.Node.BackColor.ToArgb = Color.Gray.ToArgb Then e.Cancel = True Microsoft.VisualBasic.Beep() Return End If I turned the font to italic and tried if e.Node.NodeFont.Italic = True Then e.Cancel = True Return End If I keep getting "Object reference not set to an instance of an object.". Could you or someone give me the right code? Thanks, Jerry
Show quote
Hide quote
On Sun, 10 Sep 2006 22:37:44 +0200, "Jerry" <jerry***@gmx.net> wrote: What you are looking for is:>Hi Eric, > >thnks for the help on your site. It's great. In your example you turned the >node grey and checked the color. > >If e.Node.BackColor.ToArgb = Color.Gray.ToArgb Then > e.Cancel = True > Microsoft.VisualBasic.Beep() > Return >End If > >I turned the font to italic and tried > >if e.Node.NodeFont.Italic = True Then > e.Cancel = True > Return >End If > >I keep getting "Object reference not set to an instance of an object.". >Could you or someone give me the right code? > > >Thanks, > >Jerry > If e.Node.NodeFont.Style = FontStyle.Italic Then End if The above is only valid if you specifically assigned a new drawing font to the node, otherwise, the return NodeFont is Nohting (default) and "NodeFont.Style" will throw an exception. Gene The code is correct, just make sure that e.Node and e.Node.NodeFont have a
value (i.e. not Nothing): If e.Node IsNot Nothing AndAlso e.Node.NodeFont IsNot Nothing Then If e.Node.NodeFont.Italic Then e.Cancel = True Return End If End If /claes Show quoteHide quote "Jerry" <jerry***@gmx.net> wrote in message news:ee1t2o$etu$00$1@news.t-online.com... > Hi Eric, > > thnks for the help on your site. It's great. In your example you turned > the node grey and checked the color. > > If e.Node.BackColor.ToArgb = Color.Gray.ToArgb Then > e.Cancel = True > Microsoft.VisualBasic.Beep() > Return > End If > > I turned the font to italic and tried > > if e.Node.NodeFont.Italic = True Then > e.Cancel = True > Return > End If > > I keep getting "Object reference not set to an instance of an object.". > Could you or someone give me the right code? > > > Thanks, > > Jerry >
How can I make a copy of my collection?
Difference in using "With Me" statement in dotnet VB and access VBA DownloadComplete how to write ? Referencing an Enum with Embedded Spaces Display compiled HTML help file in VB.NET app Problem with parameter naive question XML Comments in a namespace How do I paint the combo box dropdown button in a datagridview column |
|||||||||||||||||||||||