如何创建在选项卡内移动的窗格 [英] How to create pane which moves inside a tab

查看:146
本文介绍了如何创建在选项卡内移动的窗格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在tabcontrol内创建一个窗格.在窗格内,它应该具有一些控件.当我单击它时,将有一个按钮"next",它应在同一选项卡中显示另一个窗格,该窗格应具有一些其他控件.是否有可能在C#中做到这一点?如果是这样,一些想法会有所帮助.看了导航窗格,但这对我来说是必需的.

这是不添加窗格的表单.我应该在tab1内添加窗格,当我单击NEXT按钮时,窗格应在其中移动.

http://s282.photobucket.com/albums/kk269/dxm4i/? action =view¤t= form.jpg [

I want to create a pane inside a tabcontrol . Inside a pane it should have some controls . There will be a button "next" when i click on it , it should show another pane in same tab which should have some other controls . Is it possible to do this in c#?? If so some ideas will be helpful . Looked at navigation pane but it is required for me .

This is the form without adding pane . I should add pane inside tab1 in which pane should move when i click on NEXT button .

http://s282.photobucket.com/albums/kk269/dxm4i/?action=view¤t=form.jpg[^]

推荐答案

是的-只需将面板放入适当的TabPage中即可.移动它们很容易:只需更改Location属性(如果要滑出,可以在计时器中,在下一步"按钮上滑入)

这的哪一部分给您带来了问题?还是我们有沟通方面的问题?


我们不应该更改应保留在tab1中的选项卡,但是当我单击下一个按钮时,应该会出现另一个窗格.面板上有可能吗?"

是的.创建两个面板(然后调用panelFirst和PanelSecond).用适当的控件填充它们-不要在设计器中将面板拖在一起,这会将被拖拽的面板放到被拖拽的面板内.改用尺寸手柄,可能值得堆叠"面板以使其更易于使用-如果需要,可以在运行时重新放置它们.将panelFirst的Visible属性设置为true,将panelSecond设置为false.

在下一步"按钮单击处理程序"中,将panelFirst.Visible设置为false,找到panelSecond,使其与panelFirst在同一点,并将其Visible设置为true

到了这里-在同一标签页上,一个面板及其所有控件都替换为另一个面板.
Yes - just put your Panels inside the appropriate TabPage. Moving them is easy: just change the Location property (probably in a timer if you are trying to slide-out, slide-in on the Next button)

What part of this is giving you a problem? Or do we have communications problems?


"We should not change the tab it should remain in tab1 but when i click on next button another pane should appear . Is it possible on panel ??"

Yes. Create two panels (call then panelFirst and PanelSecond, say). Fill them with the appropriate controls - do not drag you panels on top of each other in the designer, that will put the dragged panel inside the dragged-onto panel. Use the size handles instead, and it may be worth "stacking" the panels to make them easier to work with - you can re-locate them at run time if you need to. Set the Visible property of panelFirst to true and panelSecond to false.

In the Next button Click handler, set panelFirst.Visible to false, locate panelSecond so it is at the same Point as panelFirst, and set it''s Visible to true

There you go - one panel and all it''s controls are replace with another, on the same tab page.


这篇关于如何创建在选项卡内移动的窗格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆