新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 软件开发 > .Net开发 > Asp.net教程 > 正文:VB.NET实现Winodws式隐现菜单

VB.NET实现Winodws式隐现菜单

新客网 XKER.COM 2004-07-06 来源: 收藏本文
主要是通过Panel和ImageButton两个控件实现,很简单.
<Script Language="VB" Runat="Server">
Sub Button1_Click(sender As Object, e As ImageClickEventArgs)
If myPanel1.Visible = True Then
myPanel1.Visible = False
sbmr.ImageUrl="images/sb_show.gif"
Else
myPanel1.Visible = True
sbmr.ImageUrl="images/sb_hide.gif"
End If
End Sub
Sub Button2_Click(sender As Object, e As ImageClickEventArgs)
If myPanel2.Visible = True Then
myPanel2.Visible = False
bjmr.ImageUrl="images/bj_show.gif"
Else
myPanel2.Visible = True
bjmr.ImageUrl="images/bj_hide.gif"
End If
End Sub
Sub Button3_Click(sender As Object, e As ImageClickEventArgs)
If myPanel3.Visible = True Then
myPanel3.Visible = False
bjkc.ImageUrl="images/kc_show.gif"
Else
myPanel3.Visible = True
bjkc.ImageUrl="images/kc_hide.gif"
End If
End Sub
Sub Button4_Click(sender As Object, e As ImageClickEventArgs)
If myPanel4.Visible = True Then
myPanel4.Visible = False
bjrk.ImageUrl="images/rk_show.gif"
Else
myPanel4.Visible = True
bjrk.ImageUrl="images/rk_hide.gif"
End If
End Sub
Sub Button5_Click(sender As Object, e As ImageClickEventArgs)
If myPanel5.Visible = True Then
myPanel5.Visible = False
bjck.ImageUrl="images/ck_show.gif"
Else
myPanel5.Visible = True
bjck.ImageUrl="images/ck_hide.gif"
End If
End Sub
Sub Button6_Click(sender As Object, e As ImageClickEventArgs)
If myPanel6.Visible = True Then
myPanel6.Visible = False
bjjh.ImageUrl="images/jh_show.gif"
Else
myPanel6.Visible = True
bjjh.ImageUrl="images/jh_hide.gif"
End If
End Sub
Sub Button7_Click(sender As Object, e As ImageClickEventArgs)
If myPanel7.Visible = True Then
myPanel7.Visible = False
bjqt.ImageUrl="images/qt_show.gif"
Else
myPanel7.Visible = True
bjqt.ImageUrl="images/qt_hide.gif"
End If
End Sub
</Script>
<html>
<head>
<title>左边框</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #CFEFFA;
}
body,td,th {
color: #000066;
}
.style4 {color: #FFFFFF}
a:link {
color: #000066;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000066;
}
a:hover {
text-decoration: none;
color: #000066;
}
a:active {
text-decoration: none;
color: #000066;
}
-->
</style></head>

<body>
<Form Runat="Server">

<Asp:ImageButton Runat="Server" Id="sbmr" ImageUrl="images/sb_show.gif" OnClick="Button1_Click" /><br>
<Asp:Panel Runat="Server" Id="myPanel1" HorizontalAlign="Left" Visible = "False">
<table width="150" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#A7D2ED" bgcolor="#CFEFFA">
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center"><a href="sbmr/addsbmr.aspx" target="mainFrame">增加</a></div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">修改</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center"><a href="sbmr/sbmr.aspx" target="mainFrame">查询</a></div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">删除</div></td>
</tr>
</table>
</Asp:Panel>

<Asp:ImageButton Runat="Server" Id="bjmr" ImageUrl="images/bj_show.gif" OnClick="Button2_Click" /><br>
<Asp:Panel Runat="Server" Id="myPanel2" HorizontalAlign="Left" Visible = "False">
<table width="150" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#A7D2ED" bgcolor="#CFEFFA">
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center"><a href="BJMR/add.aspx" target="mainFrame">增加</a></div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center"><a href="bjmr/edit.aspx" target="mainFrame">修改</a></div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center"><a href="BJMR/search.aspx" target="mainFrame">查询</a></div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">删除</div></td>
</tr>
</table>
</asp:panel>

<Asp:ImageButton Runat="Server" Id="bjkc" ImageUrl="images/kc_show.gif" OnClick="Button3_Click" /><br>
<Asp:Panel Runat="Server" Id="myPanel3" HorizontalAlign="Left" Visible = "False">
<table width="150" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#A7D2ED" bgcolor="#CFEFFA">
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center"><a href="BJKC/bjkc.aspx" target="mainFrame">查询</a></div></td>
</tr>
</table>
</asp:panel>

<Asp:ImageButton Runat="Server" Id="bjrk" ImageUrl="images/rk_show.gif" OnClick="Button4_Click" /><br>
<Asp:Panel Runat="Server" Id="myPanel4" HorizontalAlign="Left" Visible = "False">
<table width="150" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#A7D2ED" bgcolor="#CFEFFA">
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">增加</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">修改</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">查询</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">删除</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">统计</div></td>
</tr>
</table>
</asp:panel>


<Asp:ImageButton Runat="Server" Id="bjck" ImageUrl="images/ck_show.gif" OnClick="Button5_Click" /><br>
<Asp:Panel Runat="Server" Id="myPanel5" HorizontalAlign="Left" Visible = "False">
<table width="150" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#A7D2ED" bgcolor="#CFEFFA">
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">增加</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">修改</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">查询</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">删除</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">统计</div></td>
</tr>
</table>
</asp:panel>

<Asp:ImageButton Runat="Server" Id="bjjh" ImageUrl="images/jh_show.gif" OnClick="Button6_Click" /><br>
<Asp:Panel Runat="Server" Id="myPanel6" HorizontalAlign="Left" Visible = "False">
<table width="150" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#A7D2ED" bgcolor="#CFEFFA">
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center"><a href="BJJH/ydjh.aspx" target="mainFrame">应订</a></div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center"><a href="bjjh/yjjh.aspx" target="mainFrame">应交</a></div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center"><a href="bjjh/search.aspx" target="mainFrame">查询</div></a></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">增加</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">删除</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">修改</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">统计</div></td>
</tr>
</table>
</asp:panel>

<Asp:ImageButton Runat="Server" Id="bjqt" ImageUrl="images/qt_show.gif" OnClick="Button7_Click" /><br>
<Asp:Panel Runat="Server" Id="myPanel7" HorizontalAlign="Left" Visible = "False">
<table width="150" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#A7D2ED" bgcolor="#CFEFFA">
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">其他[1]</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">其他[2]</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">其他[3]</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">其他[4]</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">其他[5]</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">其他[6]</div></td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"><div align="center">其他[7]</div></td>
</tr>
</table>
</asp:panel>
</form>
</body>
</html>
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐