窗口ComboBox可以正常设定为
列1
列2
列3
列4
但是菜单ComboBox却设定为: 列1|列2|列3|列4
以下代码应该如何修改,谢谢!
Dim cmb As WinForm.ComboBox
cmb = Forms("窗口1").Controls("list") ' 这个是窗口ComboBox, 正常设定
cmb.AllowEditValue=False
Dim f As String
For Each c As Col In Tables(e.Form.TableName).Cols
If f ="" Then
f=c.Name
Else
f=f & "|" & c.Name
End If
Next
cmb.ComboList = f
cmb.SelectedIndex=0
'------------------------------
'以下是菜单ComboBox,列表无法正常设定
Dim cmb As RibbonMenu.ComboBox = RibbonTabs("功能区1").Groups("功能组1").Items("list")
Dim f As String
For Each c As Col In Tables(CurrentTable.name).Cols
If f ="" Then
f=c.Name
Else
f=f & "|" & c.Name
End If
Next
cmb.Text = f