Fengzhimei@Dot.Net
Designing My Colorful Dream

    I have a treeview in a my asp.net page, it works fine when the page has a background color, but when i set a background-image(which is defined in the <body> tag) on the page, a terrible thing happened, the treeview no longer seems to be transparent, and insted it is shown as a white box.

    I have tried treeview.styles.add() and added background colors, this seems to work, but it only allows me to change the color to something like red or blue, it doesnt allow transparent as an option. Then i hacked into treeview.htc(if you installed the Microsoft Internet Explorer WebControls for ASP .NET, you can find it in the "wwwroot/webctrl_client/1_0" folder), and get the idea that it can't be transparent. TreeView.htc is using a viewlink, which is actually a seperate document. I have changed the treeview.htc so that treeview support transparent background,here is the code:

function buildTreeFromRoot()
{
     
     bodyNode.style.direction 
= element.currentStyle.direction;
     
//this line is added for supportting transparent background
     bodyNode.style.background = "transparent";
     
var head = element.document.createElement("HEAD");
     
}

    As you can see, I just add a line code in the "buildTreeFromRoot" function, but it works
    Hope this helps

posted on 2004-10-14 17:04  fengzhimei  阅读(5248)  评论(7编辑  收藏  举报