如何在Excel-Vba中实现组合框的最小化功能?

发布于 2024-11-28 11:08:58 字数 59 浏览 0 评论 0原文

请有人帮助而不是 Excel-Vba 的新手。如何在组合框的右上角面板(就像浏览器一样)实现最小化功能?

Someone please help rather a newbie in Excel-Vba. How do i implement a minimize feature at the top right panel of a combobox something just like a browser?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

于我来说 2024-12-05 11:08:58

这是根据此帖子修改

的按钮到您的表单上,并将此代码放置在模块中的任何位置。单击切换按钮以“最小化”,然后再次单击以反转它。玩弄数字以获得您想要的高度和位置。

Dim dWidth As Double
Dim wasTop, wasLeft As Integer
Private Sub ToggleButton1_Click()
    If ToggleButton1.Value = True Then
        Me.Height = Me.Height * 0.25
        wasTop = Me.Top
        wasLeft = Me.Left
        Me.Top = 400
        Me.Left = 100
    Else
        Me.Height = dWidth
        Me.Top = wasTop
        Me.Left = wasLeft
    End If
End Sub


Private Sub UserForm_Initialize()
    dWidth = Me.Height
End Sub

This is modified from this posting

Drag a toggle button onto your form, and place this code anywhere in your module. Click the toggle to "minimize" and again to reverse it. Play around with the numbers to get the height and the position the way you want it.

Dim dWidth As Double
Dim wasTop, wasLeft As Integer
Private Sub ToggleButton1_Click()
    If ToggleButton1.Value = True Then
        Me.Height = Me.Height * 0.25
        wasTop = Me.Top
        wasLeft = Me.Left
        Me.Top = 400
        Me.Left = 100
    Else
        Me.Height = dWidth
        Me.Top = wasTop
        Me.Left = wasLeft
    End If
End Sub


Private Sub UserForm_Initialize()
    dWidth = Me.Height
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文