分类:
2009-10-11 13:52:23
ToolBar上加ComboBox 来源l:KarLand 其实不只是ComboBox,其他的Control项也可以加入 ' Need a Combox, Toolbar Private Sub Form_load() Dim btn As Button Combo1.AddItem "Item1" Combo1.AddItem "Item2" Combo1.AddItem "Item3" Combo1.Text = "Item1" Me.Show Set btn = Toolbar1.Buttons.Add() btn.Style = tbrSeparator Set btn = Toolbar1.Buttons.Add() btn.Style = tbrPlaceholder btn.Key = "ComboBox" btn.Width = 1000 Set btn = Toolbar1.Buttons.Add btn.Style = tbrDefault Set btn = Toolbar1.Buttons.Add btn.Style = tbrDefault With Combo1 Set .Container = Toolbar1 .ZOrder 0 .Width = Toolbar1.Buttons("ComboBox").Width .Top = Toolbar1.Buttons("ComboBox").Top .Left = Toolbar1.Buttons("ComboBox").Left End With Combo1.Visible = True End Sub