如何在Excel-Vba中的组合框上实现最小化功能? [英] How to Implement a minimize feature on a combobox in Excel-Vba?

查看:113
本文介绍了如何在Excel-Vba中的组合框上实现最小化功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人请帮助而不是一个新手在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?

推荐答案

这是修改从一个组合框的右上方面板, 此发布

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

这篇关于如何在Excel-Vba中的组合框上实现最小化功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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