c#的工具栏如何向VB6那样插进去的按钮都是立体的
来源:百度知道 编辑:UC知道 时间:2024/06/05 18:05:49
下文将为您演示如何将DataGrid实现为一个立体的表格,以及如何实现在Image按钮中实现立体感的效果。为了完成上面的内容我们首先要对CSS的自定义样式有所了解,然后就是一些简单的js代码。
为了实现立体大DataGrid我们需要创建一个工程,里面有一个DataGrid以及绑定在其上的数据,代码如下:
<asp:datagrid id="DataGrid1" runat="server" GridLines="Horizontal" style="BORDER-COLLAPSE:separate">
<ItemStyle ></ItemStyle>
</asp:datagrid>
上面的代码中有一个地方非常重要,就是设置style的属性那里,记得一定要写成这样。有了这个数据网格以后我们需要写一个可以实现立体效果的css样式,CSS样式如下所示:
<style>
.SolidDataGrid{
CoolSolidDataGrid:expression(ApplySolidTable(this));
border-color:#FFFFFF;
border-bottom-width:0px;
border-left-width:0px;
border-right-width:0px;
border-top-width:0px;
}
.SolidDataGridItem{
CoolSolidDataGridRow:expression(ApplySolidTr(this));
}
</style>