快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

发布一个通用面板程序(htc)

panel.htc

<PUBLIC:PROPERTY NAME="ImagesSrc" />
<PUBLIC:PROPERTY NAME="PanelCaption" />
<PUBLIC:ATTACH EVENT="ondocumentready" HANDLER="DoInit" />
<PUBLIC:ATTACH EVENT="onclick" HANDLER="load" />
<SCRIPT LANGUAGE="jscript">
window.Panel=new Array();
function DoInit(){
if (!element.document.getElementById("oPanelHeader")){
inithtml=\\'<table height="31" cellSpacing="0" id="oPanelHeader" cellPadding="0" width="98%" border="0" align="center" >\\'+
\\'<tr>\\'+
\\' <td class="plTitleSpace" width="1%" height="31">&nbsp;</td>\\'+
\\' <td class="plTitleSelect" width="15%" height="31" isTitle="true">\\'+
\\' <table style="FONT-SIZE: 12px" height="25">\\'+
\\' <tr>\\'+
\\' <td><IMG height="18" src="\\'+ImagesSrc+\\'" width="18"></td>\\'+
\\' <td vAlign="bottom">\\'+PanelCaption+\\'</td>\\'+
\\' </tr>\\'+
\\' </table>\\'+
\\' </td>\\'+
\\' <td class="plTitleSpace" width="*%" height="31">&nbsp;</td>\\'+
\\'</tr>\\'+
\\'</table>\\';
element.insertAdjacentHTML("beforeBegin",inithtml);
oPanelHeader.attachEvent("onclick",oPanelHeaderClick);
}
else{
var rows=oPanelHeader.rows[0];
var cell=rows.insertCell(rows.cells.length-1);
cell.className="plTitleSpace";
cell.width="1%";
cell.innerHTML="&nbsp;";
var cell=rows.insertCell(rows.cells.length-1);
cell.className="plTitleUnSelect";
cell.isTitle="true";
cell.width="15%";
cell.innerHTML= \\'<table style="FONT-SIZE: 12px" height="25">\\'+
\\' <tr>\\'+
\\' <td><IMG height="18" src="\\'+ImagesSrc+\\'" width="18"></td>\\'+
\\' <td vAlign="bottom">\\'+PanelCaption+\\'</td>\\'+
\\' </tr>\\'+
\\'</table>\\';
}
window.Panel[window.Panel.length]=element;
}
function oPanelHeaderClick(){
var e = GetObj(window.event.srcElement);
if (e)
if (e.className=="plTitleUnSelect"){
for(i=0;i<window.Panel.length;i++){
window.Panel[i].className="plPanelUnSelect";
oPanelHeader.rows[0].cells[i*2+1].className="plTitleUnSelect";
}
window.Panel[(e.cellIndex+1)/2-1].className="plPanelSelect";
e.className="plTitleSelect";
}
}
function GetObj(src){
if (src.parentElement.tagName!="BODY"){
if (src.isTitle=="true") return src;
return GetObj(src.parentElement)
}
return null;
}
</script>

Common.css

.plTitleSelect
{
border-right: #999999 1px solid;
border-top: #999999 1px solid;
font-size: 12px;
border-left: #999999 1px solid;
cursor: hand;
border-bottom: #999999 0px solid;
background-color: #ffffff;
text-align: center;
}
.plTitleUnSelect
{
border-right: #999999 1px solid;
border-top: #999999 1px solid;
font-size: 12px;
border-left: #999999 1px solid;
cursor: hand;
border-bottom: #999999 1px solid;
background-color: #ececec;
text-align: center;
}
.plTitleSpace
{
font-size: 12px;
border-bottom: #999999 1px solid;
text-align: center;
}
.plPanelSelect
{
border-right: #999999 1px solid;
border-top: #999999 0px solid;
display: block;
font-size: 12px;
border-left: #999999 1px solid;
border-bottom: #999999 1px solid;
background-color: #ffffff;
behavior: url(panel.htc);
}
.plPanelUnSelect
{
border-right: #999999 1px solid;
border-top: #999999 0px solid;
display: none;
font-size: 12px;
border-left: #999999 1px solid;
border-bottom: #999999 1px solid;
background-color: #ffffff;
behavior: url(panel.htc);
}

index.htm

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<LINK href="Common.css" type="text/css" rel="Stylesheet">
</HEAD>
<BODY>
<br>
<form>
<table class="plPanelSelect" id="oContent" height="90%" cellSpacing="0" cellPadding="0"
width="98%" border="0" ImagesSrc="sheet.gif" PanelCaption="个人信息" align="center">
<tr>
<td width="100%" align="center" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="107">
<tr>
<td colspan="2" height="26"> </td>
</tr>
<tr>
<td height="26" width="50%">用户名:</td>
<td width="50%" height="26">密码:</td>
</tr>
<tr>
<td height="26" width="50%"></td>
<td width="50%" height="26">
</td>
</tr>
<tr>
<td height="27" width="50%">姓名:</td>
<td width="50%" height="27"> </td>
</tr>
<tr>
<td height="27" width="50%"><input type="submit" value="test" name="es"> </td>
<td width="50%" height="27"></td>
</tr>
</table>
</td>
</tr>
</table>
<table class="plPanelSelect" id="oContent" height="90%" cellSpacing="0" cellPadding="0"
width="98%" border="0" ImagesSrc="sheet.gif" PanelCaption="具体信息" align="center">
<tr>
<td width="100%" align="center" valign="top">
gdfgdfgdf
</td>
</tr>
</table>

</form>
</BODY>
</HTML>





返回类别: 教程
上一教程: 一个有KeepConnection开关的C#的Database类
下一教程: 用c#写的smtp邮件发送类

您可以阅读与"发布一个通用面板程序(htc)"相关的教程:
· .Net程序如何防止被注入(整站通用)
· 一个完整的网上追捕的原程序
· 我的.Net下应用程序发布问题的简易解决方案
· 一个功能完善的专栏治理的程序->这是asp.net的第二个应用(三)
· 一个功能完善的专栏治理的程序->这是asp.net的第二个应用(一)
    微笑服务 优质保证 索取样品