使用默认背景颜色选择器弹出菜单
概括: 我正在尝试制作一个带有一些选项的自定义弹出菜单,其中我想从“文本格式”选项卡中插入默认的背景颜色选择器。这样,如果我知道已选择了哪种颜色代码,我就可以将其设置为文本框的背景颜色。
我尝试的是:
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:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论