开发者

how to shift windows forms controls?

开发者 https://www.devze.com 2022-12-28 05:52 出处:网络
How can i get same functionality in windows forms as in the next example. When ihave two links one beneath, and when i click first link a panel is visibleunder it and next link is shifted. When i clic

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消