How can i get same functionality in windows forms as in the next example. When i have two links one beneath, and when i click first link a panel is visibleunder it and next link is shifted. When i click again the panel is invisible and second link shifted back.
<script type="text/javascript">
function toggleDivState(divName)
{
var ctl = window.document.getElementById(divName);
if (ctl.style.display == "none")
ctl.style.display = "";
else
ctl.style.display = "none开发者_运维问答";
}
</script>
<a href="javascript:toggleDivState('poll<%# Eval("ID") %>');">
<div style="display: none;" id="poll<%# Eval("ID") %>">
Something like this? on click:
control1.Visible = !control1.Visible;
control2.Visible = !control1.Visible;
??
You can use panels that have the 'Dock' property said to 'Top' - you can then adjust the height of said panel to suit.
Sound like you need a FlowLayoutPanel with FlowDirection = TopDown
.
Put within this Panel your Link, Panel, Link2 and Panel2. Within the LinkClick event you set the Panel.Visible = !Panel.Visible
.
精彩评论