By sinory
使用C1WebToolBar控件可以十分方便的创建类似Windows的工具条.
首先添加如下引用
使用C1WebToolBar控件可以十分方便的创建类似Windows的工具条.
首先添加如下引用
<%@ Register Assembly="C1.Web.Command.2" Namespace="C1.Web.Command" TagPrefix="c1c" %>
然后定义自己的工具条: <c1c:C1WebToolBar ID="C1WebToolBar1" runat="server" BorderColor="#3B619C" BackImageUrl="images/barbg.gif"
BorderStyle="Solid" BorderWidth="1px" ItemPadding="2px" ItemSize="22px" Width=100%
Layout="Horizontal" Padding="0px" AutoPostBack=True OnItemClick="C1WebToolBar1_ItemClick">
<SeparatorStyle BackImageSize="5px" BackImageUrl="res:af_vertdelim2003_tb01.gif" />
<MouseOverItemStyle BorderColor="#0A246A" BorderStyle="Solid" BackColor="#FFDFA9" BorderWidth="1px" />
<ItemStyle Font-Names="Tahoma" Font-Size="8pt" />
<Groups>
<c1c:C1WebToolBarGroup>
<Items>
<c1c:C1WebToolBarItem ClientScripts="" Text="删除" CommandName="delete" ItemStyle-ImageUrl="./images/delete.gif" ToolTip="删除选中的操作日志"> </c1c:C1WebToolBarItem>
</Items>
</c1c:C1WebToolBarGroup>
</Groups>
<Groups>
<c1c:C1WebToolBarGroup>
<Items>
<c1c:C1WebSeparator> </c1c:C1WebSeparator>
<c1c:C1WebToolBarItem ClientScripts="" CommandName="ExpToExcel" ItemStyle-ImageUrl="./images/expexcel.gif" Text="导出到Excel" ToolTip="保存成EXCEL文件">
</c1c:C1WebToolBarItem>
<c1c:C1WebToolBarItem ClientScripts="" NavigateUrl="javascript:savefile();" Text="保存为Html" ItemStyle-ImageUrl="./images/savehtml.gif" ToolTip="保存成HTML文件">
</c1c:C1WebToolBarItem>
<c1c:C1WebSeparator> </c1c:C1WebSeparator>
<c1c:C1WebToolBarItem ClientScripts="" Text="打印" NavigateUrl="javascript:CallPrint('printContent');" ItemStyle-ImageUrl="./images/printpage.gif" ToolTip="打印">
</c1c:C1WebToolBarItem>
<c1c:C1WebToolBarItem ClientScripts="" Text="打印预览" NavigateUrl="javascript:CallPrintView('printContent');" ItemStyle-ImageUrl="./images/printview.gif" ToolTip="打印预览"> </c1c:C1WebToolBarItem>
<c1c:C1WebSeparator> </c1c:C1WebSeparator>
<c1c:C1WebToolBarItem ClientScripts="" CommandName="RefPage" Text="刷新页面" ItemStyle-ImageUrl="./images/refpage.gif" ToolTip="刷新页面">
</c1c:C1WebToolBarItem>
</Items>
</c1c:C1WebToolBarGroup>
</Groups>
<DisabledItemStyle ForeColor="#9D9DA1" />
<SelectedItemStyle BackColor="#FFB663" BorderColor="#000080" BorderStyle="Solid" BorderWidth="1px" />
<MouseOverSelectedItemStyle BackColor="#FFB663" BorderColor="#000080" BorderStyle="Solid" BorderWidth="1px" /> </c1c:C1WebToolBar>
每个属性的意思和它的名称所示.
BorderStyle="Solid" BorderWidth="1px" ItemPadding="2px" ItemSize="22px" Width=100%
Layout="Horizontal" Padding="0px" AutoPostBack=True OnItemClick="C1WebToolBar1_ItemClick">
<SeparatorStyle BackImageSize="5px" BackImageUrl="res:af_vertdelim2003_tb01.gif" />
<MouseOverItemStyle BorderColor="#0A246A" BorderStyle="Solid" BackColor="#FFDFA9" BorderWidth="1px" />
<ItemStyle Font-Names="Tahoma" Font-Size="8pt" />
<Groups>
<c1c:C1WebToolBarGroup>
<Items>
<c1c:C1WebToolBarItem ClientScripts="" Text="删除" CommandName="delete" ItemStyle-ImageUrl="./images/delete.gif" ToolTip="删除选中的操作日志"> </c1c:C1WebToolBarItem>
</Items>
</c1c:C1WebToolBarGroup>
</Groups>
<Groups>
<c1c:C1WebToolBarGroup>
<Items>
<c1c:C1WebSeparator> </c1c:C1WebSeparator>
<c1c:C1WebToolBarItem ClientScripts="" CommandName="ExpToExcel" ItemStyle-ImageUrl="./images/expexcel.gif" Text="导出到Excel" ToolTip="保存成EXCEL文件">
</c1c:C1WebToolBarItem>
<c1c:C1WebToolBarItem ClientScripts="" NavigateUrl="javascript:savefile();" Text="保存为Html" ItemStyle-ImageUrl="./images/savehtml.gif" ToolTip="保存成HTML文件">
</c1c:C1WebToolBarItem>
<c1c:C1WebSeparator> </c1c:C1WebSeparator>
<c1c:C1WebToolBarItem ClientScripts="" Text="打印" NavigateUrl="javascript:CallPrint('printContent');" ItemStyle-ImageUrl="./images/printpage.gif" ToolTip="打印">
</c1c:C1WebToolBarItem>
<c1c:C1WebToolBarItem ClientScripts="" Text="打印预览" NavigateUrl="javascript:CallPrintView('printContent');" ItemStyle-ImageUrl="./images/printview.gif" ToolTip="打印预览"> </c1c:C1WebToolBarItem>
<c1c:C1WebSeparator> </c1c:C1WebSeparator>
<c1c:C1WebToolBarItem ClientScripts="" CommandName="RefPage" Text="刷新页面" ItemStyle-ImageUrl="./images/refpage.gif" ToolTip="刷新页面">
</c1c:C1WebToolBarItem>
</Items>
</c1c:C1WebToolBarGroup>
</Groups>
<DisabledItemStyle ForeColor="#9D9DA1" />
<SelectedItemStyle BackColor="#FFB663" BorderColor="#000080" BorderStyle="Solid" BorderWidth="1px" />
<MouseOverSelectedItemStyle BackColor="#FFB663" BorderColor="#000080" BorderStyle="Solid" BorderWidth="1px" /> </c1c:C1WebToolBar>