hamadou,祝贺你升星,对了,问下大家,怎么才能在vb.net里做成qq里或者是studio.net里,左侧那样的菜单

wudiccj 2005-03-25 04:02:12
hamadou,祝贺你升星,对了,问下大家,怎么才能在vb.net里做成qq里或者是studio.net里,左侧那样的菜单,点下按扭,就拉下去,有很多其他选项出现,大家懂我的意思吗,就象qq里,我的好友陌生人那样的菜单,studio.net左侧的工具箱菜单那样的。
...全文
135 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
haoco 2005-03-27
  • 打赏
  • 举报
回复
up
hamadou 2005-03-25
  • 打赏
  • 举报
回复
呵呵!谢谢!我们一起努力吧!
这个问题直接写也可以,不过效果不是很好,可以考虑第三方控件,比如说dotnetbar,可以很好地实现这个功能,还有很好的xp风格的菜单和工具栏。不过似乎不是很稳定。我个人也不太喜欢去找太多的别人弄好的控件来用。下面是我以前写的类似这样的东西,不过时间很早了,大概是刚开始学的东西了。呵呵,没有考虑创建用户控件什么的。重绘控件应该会好些!希望能给你些帮助!


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'给Panel1设置初始位置
Me.Panel1.Width = Me.Label1.Width + 5
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'当Panel1最大化时,如果将光标移出Panel1,则在1.5秒后自动关闭工具框
If Me.Panel1.Width = 128 Then
If MousePosition.X > Me.Left + Me.Panel1.Width Then
Button2_Click_1(sender, e)
End If
End If
End Sub

Private Sub Label1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseHover
While Me.Panel1.Width < 128
Me.Panel1.Width = Panel1.Width + 1
End While
Timer1.Enabled = True
End Sub


'Private Sub ToolBar2_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs)
'Select Case ToolBar2.Buttons.IndexOf(e.Button)
'Case 1
' MessageBox.Show("hehe")
' End Select
' End Sub
'收缩回去
Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Button4_Click(sender, e)
While Me.Panel1.Width > Me.Label1.Width + 5
Me.Panel1.Width = Panel1.Width - 1
End While
Timer1.Enabled = False
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'首先调用最下层的折叠事件
'Button4_Click(sender, e)
' Panel5.SuspendLayout()
While Pnlthree.Height > Button4.Height + 5
Pnlthree.Height = Pnlthree.Height - 1
End While
'调用下层的折叠事件,同时移动Y轴和缩短高度,保证其向下移动并不引起最下层的闪烁
While Pnltwo.Height > Button4.Height + 3
Pnltwo.Top = Pnltwo.Top + 1
Pnltwo.Height = Pnltwo.Height - 1
End While
'Panel5.ResumeLayout()
End Sub


'//控制展开的代码
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
While Pnlthree.Height > Button4.Height + 5
Pnlthree.Height = Pnlthree.Height - 1
End While
While Pnltwo.Top > Button3.Top + Button3.Height + 2
Pnltwo.Top = Pnltwo.Top - 1
Pnltwo.Height = Pnltwo.Height + 1
End While
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
While Pnltwo.Top > Button3.Top + Button3.Height + 2
Pnltwo.Top = Pnltwo.Top - 1
Pnltwo.Height = Pnltwo.Height + 1
End While
While Pnlthree.Top > Pnltwo.Top + Button6.Height + 5
Pnlthree.Height = Pnlthree.Height + 1
Pnlthree.Top = Pnlthree.Top - 1
End While
End Sub
'//////////////
'悬停工具栏
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = False
End Sub

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧