Hi Bob,
You can easily resize the buttons by changing the ImageList associated with
the Toolbar.
Let's say, for example, that I want to have the option of showing large
buttons or small buttons. The large buttons are 32x32 in size and the
small buttons are 16x16. Here's how you would accomplish that:
1) Add two ImageList controls to your form.
2) Add the 32x32 images to the first ImageList control.
3) Add the 16x16 images to the second ImageList control.
In your code, when you want to change the size of the buttons, you simply
change the ImageList that is associated with the Toolbar control. Here is
an example using an Option button called optButtonSize to change the
buttons.
Private Sub optButtonSize_Click(Index As Integer)
Dim button As Button
Select Case Index
Case 0 ' option button to change to large buttons...
Toolbar1.ImageList = ImageList1
Case 1 ' option button to change to small buttons...
Toolbar1.ImageList = ImageList2
End Select
' reset the Image property for each toolbar button...
For Each button in Toolbar1.Buttons
button.Image = button.Index
Next button
End Sub
In this example, you will notice that I have explicitly reset the Image
index for each button. If you don't do this, the image will not display.
Also note that if you have a DisabledImageList and/or a HotImageList, they
must all be set so that they contain the same sized images. You cannot
have different sized images in different ImageList controls that are
assigned to the Toolbar.
I hope that helps.
Jim Cheshire
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2002 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message
| Subject: Toolbar Button Size
| Date: Wed, 20 Mar 2002 07:43:44 -0800
| Lines: 3
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcHQJgQwnQclH6xKTea2QJUilLQPVA==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
| Newsgroups: microsoft.public.vb.controls
| NNTP-Posting-Host: TKMSFTNGXA07 10.201.232.166
| Path: cpmsftngxa08!cpmsftngxa07
| Xref: cpmsftngxa08 microsoft.public.vb.controls:127773
| X-Tomcat-NG: microsoft.public.vb.controls
|
| What is the syntax for changing a toolbars button size?
| I have tried "toolbar1.buttonsize.height = 24" but that
| does't work.
|