Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Set Css of IE TreeView


Message #1 by Arjen Oetomo <ArjenO@c...> on Wed, 20 Nov 2002 15:21:29 +0100
In serveral forums, people discuss setting the stylesheet references on a
Microsoft IE TreeView. It seems that setting a direct reference to a
stylesheet class isn't possible,  there is no built in mechanism on the
Treeview control  for applying the stylesheet (why?). 

Most solutions posted said that the best way to do it is to set the style by
code, without a reference to the stylesheet.

	Me.treeview1.DefaultStyle = New CssCollection("font-size: 9pt;")

Thats a nice workaround, but that means that you have to explicit set the
CssCollection of every treeView in your application. Or perhaps create 1
general class which you can refer too, but I see that as a last option.
There should probably be a better solution like using the stylesheet as the
source and retrieve the class 

I want the source to be a stylesheet-class. I would like to have code like:

Me.treeview1.DefaultStyle = GetCssCollection("myCssClass") 

The GetCssCollection then returns the CssCollection type which the treeview
can use to set its defaultstyle/hoverstyle/etc...

I can't figure out how to do the following: How can I read a Class/attribute
out of the StyleSheet by code and set the attributes in a string?


  Return to Index