使用默认背景颜色选择器弹出菜单

发布于 2025-01-21 10:13:17 字数 930 浏览 3 评论 0原文

概括: 我正在尝试制作一个带有一些选项的自定义弹出菜单,其中我想从“文本格式”选项卡中插入默认的背景颜色选择器。这样,如果我知道已选择了哪种颜色代码,我就可以将其设置为文本框的背景颜色。

我尝试的是:

Sub Make_Popup_CuloriForm()

'Add PopUp menu
With Application.CommandBars.Add(Name:=Mname, Position:=msoBarPopup, _
                                MenuBar:=False, Temporary:=True)
    
With .Controls.Add(Type:=msoControlButton)
    .Caption = "Actualizeaza formular"
    .OnAction = "fCuloriForm"
    .Parameter = "1"
    .FaceId = 159
    .BeginGroup = True
End With

 With .Controls.Add(Type:=msoControlButton)
    .Caption = "Elimina formular"
    .OnAction = "fCuloriForm"
    .Parameter = "2"
    .FaceId = 330
    .BeginGroup = True
End With

End With

' Application.CommandBars.Add c(36)
End Sub

我需要的是在弹出菜单中添加另一个控件,但这应该是内置的彩色选择器。

谢谢

LE: 这就是我需要的: “

Summary:
I'm trying to make a custom popup menu with some options, amongst which i would like to insert the default background color picker from the Text Formatting tab. With this, i would love if i could know which color code has been picked so i can set it as a background color for a textbox.

What i have tried:

Sub Make_Popup_CuloriForm()

'Add PopUp menu
With Application.CommandBars.Add(Name:=Mname, Position:=msoBarPopup, _
                                MenuBar:=False, Temporary:=True)
    
With .Controls.Add(Type:=msoControlButton)
    .Caption = "Actualizeaza formular"
    .OnAction = "fCuloriForm"
    .Parameter = "1"
    .FaceId = 159
    .BeginGroup = True
End With

 With .Controls.Add(Type:=msoControlButton)
    .Caption = "Elimina formular"
    .OnAction = "fCuloriForm"
    .Parameter = "2"
    .FaceId = 330
    .BeginGroup = True
End With

End With

' Application.CommandBars.Add c(36)
End Sub

What i need is to add another control to the popup menu, but that should be the builtin color picker.

thank you

LE:
This is what i need:
like this

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文