首页 > 编程 > .NET > 正文

VB.NET实现Winodws式隐现菜单

2024-07-10 13:05:26
字体:
来源:转载
供稿:网友
主要是通过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>注册会员,创建你的web开发资料库,
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表