Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 6, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Placing A Combo Box Onto A Toolbar

To put a combo box on a toolbar, create a place holder and position the combo box above the place holder in the z-order. You can't place the combo box inside the place holder. Instead, follow these steps:
  • Create a button with the PlaceHolder style.
  • Show the form.
  • In the Form_Load event set the Top and Left properties of the combo box to the same value as the PlaceHolder button.
  • Set the z-order of the combo box to zero to bring it to the front.
  • In the Form_Resize event, make sure the Top and Left properties of the combo box are the same as the PlaceHolder button.
     Private Sub Form_Load()
    	Dim btnX As Button
    	Set btnX = Toolbar1.Buttons.Add()
    	btnX.Style = tbrSeparator
    	Set btnX = Toolbar1.Buttons.Add()
    	btnX.Style = tbrPlaceholder
    	btnX.Key = "combo"
    	btnX.Width = 2000
    	With Combo1
    		.ZOrder 0
    		.Width = Toolbar1.Buttons("combo").Width
    		.Top = Toolbar1.Buttons("combo").Top
    		.Left = Toolbar1.Buttons("combo").Left
    	End With
    End Sub
  • A. Nicklas
    Comment and Contribute






    (Maximum characters: 1200). You have 1200 characters left.



    Thanks for your registration, follow us on our social networks to keep up-to-date