Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default CommandBar Resize

I have created a floating commandbar with 3 buttons.
When it shows, the shape defaults to 1 button deep by 3
wide. I can change the shape on screen by using the
mouse to show 3 deep by 1 wide but how can I
programatically do this? It's like doing a wrapround,
squeeze the width and increase the height. '.Height'
resizes the buttons ok but does not work on the bar.
I'd appreciate any views.

T.I.A

purple
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default CommandBar Resize

"purple" wrote in message
...
I have created a floating commandbar with 3 buttons.
When it shows, the shape defaults to 1 button deep by 3
wide. I can change the shape on screen by using the
mouse to show 3 deep by 1 wide but how can I
programatically do this? It's like doing a wrapround,
squeeze the width and increase the height. '.Height'
resizes the buttons ok but does not work on the bar.
I'd appreciate any views.


Hi Purple,

If you set the Width property of your command bar to the width of one
button, the buttons should stack automatically. The width of a standard
command bar button is 39, so the following should do the trick:

CommandBars("YourBarName").Width = 39

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default CommandBar Resize

Thanks fo rthe reply but I must be missing something. No
matter what value I set it doesn't seem to make any
difference. This is the code I'm using:
Option Explicit
Option Private Module
Sub InstallFloatingMenu()
Dim floatbar, button1, button2, button3


On Error Resume Next
Application.CommandBars("Edit Income
Parameters").Delete
On Error GoTo 0

'Create floating menu bar and set initial position to
avoid editing form
Set floatbar = CommandBars.Add("Edit Income
Parameters", Position:=msoBarFloating)
With floatbar
.Left = 20
.Top = 200
.Width = 39
End With

'Add buttons and properties
Set button1 = floatbar.Controls.Add(msoControlButton)
With button1
.Width = 65
.Style = msoButtonIconAndCaption
.Caption = "Open"
.FaceId = 23
.OnAction = "FrmInitialise"
End With

Set button2 = floatbar.Controls.Add(msoControlButton)
With button2
.Width = 85
.Style = msoButtonIconAndCaption
.Caption = "Minimise"
.FaceId = 317
.OnAction = "FrmMinimise"
End With

Set button3 = floatbar.Controls.Add(msoControlButton)
With button3
.Width = 85
.Style = msoButtonIconAndCaption
.Caption = "Restore"
.FaceId = 316
.OnAction = "FrmMaximise"
End With

floatbar.Visible = True

End Sub

purple
-----Original Message-----
"purple" wrote in

message
...
I have created a floating commandbar with 3 buttons.
When it shows, the shape defaults to 1 button deep by 3
wide. I can change the shape on screen by using the
mouse to show 3 deep by 1 wide but how can I
programatically do this? It's like doing a wrapround,
squeeze the width and increase the height. '.Height'
resizes the buttons ok but does not work on the bar.
I'd appreciate any views.


Hi Purple,

If you set the Width property of your command bar to

the width of one
button, the buttons should stack automatically. The

width of a standard
command bar button is 39, so the following should do the

trick:

CommandBars("YourBarName").Width = 39

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default CommandBar Resize

Hi Rob
Got it. I can only set the width after the bar has been
made visible!! Yeah :) :0

Many Thanks
-----Original Message-----
Thanks fo rthe reply but I must be missing something.

No
matter what value I set it doesn't seem to make any
difference. This is the code I'm using:
Option Explicit
Option Private Module
Sub InstallFloatingMenu()
Dim floatbar, button1, button2, button3


On Error Resume Next
Application.CommandBars("Edit Income
Parameters").Delete
On Error GoTo 0

'Create floating menu bar and set initial position

to
avoid editing form
Set floatbar = CommandBars.Add("Edit Income
Parameters", Position:=msoBarFloating)
With floatbar
.Left = 20
.Top = 200
.Width = 39
End With

'Add buttons and properties
Set button1 = floatbar.Controls.Add(msoControlButton)
With button1
.Width = 65
.Style = msoButtonIconAndCaption
.Caption = "Open"
.FaceId = 23
.OnAction = "FrmInitialise"
End With

Set button2 = floatbar.Controls.Add(msoControlButton)
With button2
.Width = 85
.Style = msoButtonIconAndCaption
.Caption = "Minimise"
.FaceId = 317
.OnAction = "FrmMinimise"
End With

Set button3 = floatbar.Controls.Add(msoControlButton)
With button3
.Width = 85
.Style = msoButtonIconAndCaption
.Caption = "Restore"
.FaceId = 316
.OnAction = "FrmMaximise"
End With

floatbar.Visible = True

End Sub

purple
-----Original Message-----
"purple" wrote in

message
...
I have created a floating commandbar with 3 buttons.
When it shows, the shape defaults to 1 button deep by

3
wide. I can change the shape on screen by using the
mouse to show 3 deep by 1 wide but how can I
programatically do this? It's like doing a wrapround,
squeeze the width and increase the height. '.Height'
resizes the buttons ok but does not work on the bar.
I'd appreciate any views.


Hi Purple,

If you set the Width property of your command bar

to
the width of one
button, the buttons should stack automatically. The

width of a standard
command bar button is 39, so the following should do

the
trick:

CommandBars("YourBarName").Width = 39

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default CommandBar Resize

"purple" wrote in message
...
Hi Rob
Got it. I can only set the width after the bar has been
made visible!! Yeah :) :0


Hi Purple,

Sorry, I should have made that clear. Glad you figured it out!

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default CommandBar Resize

01/04/2005 21:30:44
Rob Bovey wrote in message


"purple" wrote in message
...
I have created a floating commandbar with 3 buttons.
When it shows, the shape defaults to 1 button deep by 3
wide. I can change the shape on screen by using the
mouse to show 3 deep by 1 wide but how can I
programatically do this? It's like doing a wrapround,
squeeze the width and increase the height. '.Height'
resizes the buttons ok but does not work on the bar.
I'd appreciate any views.


Hi Purple,

If you set the Width property of your command bar to the width

of one
button, the buttons should stack automatically. The width of a

standard
command bar button is 39, so the following should do the trick:

CommandBars("YourBarName").Width = 39

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM
Commandbar frustration. Julian Cox Excel Programming 6 July 23rd 04 08:57 PM
Add-In needs to create CommandBar lucp Excel Programming 8 June 27th 04 01:46 PM
commandbar Greg Prost[_2_] Excel Programming 2 November 21st 03 11:42 AM


All times are GMT +1. The time now is 09:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"