vb.net中的手风琴控件? [英] Accordion control in vb.net?

查看:127
本文介绍了vb.net中的手风琴控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在VB.Net中开发手风琴控件(如Asp.net Ajax中一样).有人可以帮忙吗?

I want to develop Accordion control (as in Asp.net Ajax) in VB.Net. Can someone help?

推荐答案

在基本框架中没有什么可以做到这一点.最近的
WinForms可能是在我的电脑"左侧菜单中看到的ExplorerBar功能.这可以从Infragistics/DevExpress/等第三方公司购买.

周围也有免费的可折叠GroupBox实现,
工作,或者您可以通过在UserControl中绘制和处理非客户区域事件来创建自己的事件.
试试这个:
主题Windows XP样式的资源管理器栏 [
There is nothing in the basic framework that will do this. The closest
thing for WinForms is probably the ExplorerBar functionality seen in the left menu in "My Computer". This is available commercially from third party companies like Infragistics/DevExpress/etc.

There are also free collapsible GroupBox implementations around that may
work, or you can create your own by drawing and handling the non client area events in a UserControl.
Try this:
Themed Windows XP style Explorer Bar[^]


您好,

在Winforms中没有可以用来创建手风琴的控件,但是您只需要对它的手风琴制作过程有一点想像力即可.

我简单地做了一个简单的示例,在Winforms中看起来像是98%的手风琴.

这是我使用过的控件,但是您可以按照逻辑
使用其他控件
工具
面板
单选按钮2或3将起作用
2个计时器
1个用于显示的按钮和1个用于隐藏的按钮

上下手风琴的逻辑
1.将单选按钮放在面板内部.
2.获取适合面板内部单选按钮的尺寸,并记住或注意.
3.将面板的高度尺寸设置为零,并设置visible = false
4.现在显示代码按钮,然后启用timer1,它将使动画显示

私有子Timer1_Tick(作为对象发送,作为EventArgs发送)处理Timer1.Tick
如果Panel1.Height> = 60则''60是适合我的单选按钮的高度
Panel1.Height + = 3''这将执行动画
如果结束
结束子

5.现在为隐藏代码按钮,然后禁用timer1并启用2,这将使隐藏动画

私有子Timer2_Tick(作为对象发送,作为EventArgs发送)处理Timer2.Tick
如果Panel1.Height> 0然后
Panel1.Height-= 3
其他
Panel1.Height = 0
Panel1.Visible = False
Timer2.Enabled =假
如果结束
结束子


这就是执行该操作的逻辑,您可以将其应用于所需的任何内容.

希望这会有所帮助
Elieser Legaspi
Hi there,

There''s no control that can be use to create an accordion in winforms but you just need to have a little imagination on how it accordion process.

I simple made a simple example that may look like 98% accordion in winforms.

here are the controls that I''ve used, but you can use other controls just follow the logic

Tools
Panel
Radio Buttons 2 or 3 will do
2 Timers
1 button for showing and 1 for hiding

Logic for an updown accordion
1. Put the radio buttons inside the panel.
2. Get the size that will fit the radio button inside the panel and remember or note it.
3. Set the height size of panel to zero and set visible = false
4. now code button for showing then enable the timer1 that will make the animation to show

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If Panel1.Height >= 60 Then '' 60 was the height that will fit my radio buttons
Panel1.Height += 3 '' this will do the animation
End If
End Sub

5. now code button for hiding then disable timer1 and enable 2 that will make the hiding animation

Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
If Panel1.Height > 0 Then
Panel1.Height -= 3
Else
Panel1.Height = 0
Panel1.Visible = False
Timer2.Enabled = False
End If
End Sub


And thats the logic on how to do it, you can apply to whatever you desires.

Hope this helps
Elieser Legaspi


这篇关于vb.net中的手风琴控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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