LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to increase size of image in button (msocontrolbutton) of custom toolbar of Excel


Excel 2000 version only
=======================
Image size appears in button(msocontrolbutton) of custom toolbar Excel
2000 is very small and blurred using below code. How I can increase
size of image in button (msocontrolbutton) as well as brightness of
image in custom toolbar?

I am able to increase size of button using width and height property
but image appears in center of button as 16X16. How to fit image to
button(msocontrolbutton)?

It would be really great help for me……

My code:

'========================================
Const cImgCommandBarID As String = "TMC Img Toolbar"
'Image code
Dim cbImgBar As CommandBar

Set cbImgBar = CommandBars.Add(Name:=cImgCommandBarID,
Position:=msoBarTop)

'cbImgBar.context = 1000



Dim cbImage As CommandBarControl



Dim imgTool As Shape

Dim sFileName, ImgSheet

sFileName = ActiveWorkbook.Path & "\Images\ABC.jpg"

Const sNAME = "MyToolFace"

'================

' hide appearance of picture from the user

Application.ScreenUpdating = False



' insert picture from file and copy inserted picture

ActiveSheet.Pictures.Insert(sFileName).CopyPicture
Appearance:=xlScreen, Format:= xlBitmap



Set cbImage = cbImgBar.Controls.Add(Type:=msoControlButton)

With cbImage

'.FaceId = 198

.Caption = "TheMarketsImage"

.Style = msoButtonIcon

.Width = 120

.Height = 100

.PasteFace

End With

' remove the inserted picture

ActiveSheet.Pictures(ActiveSheet.Pictures.Count).D elete

Application.ScreenUpdating = True


--
padam
------------------------------------------------------------------------
padam's Profile: http://www.excelforum.com/member.php...o&userid=37407
View this thread: http://www.excelforum.com/showthread...hreadid=570882

 
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
Source Excel Template Pops Up when using a custom toolbar Murray Excel Discussion (Misc queries) 3 December 7th 05 12:04 AM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
excel should have a floating "custom view" toolbar pablo Excel Worksheet Functions 2 July 4th 05 08:31 PM
How do I convert a picture (bmp or jpg) to a excel button image? . Fausto Excel Discussion (Misc queries) 0 April 1st 05 06:39 PM
Stubborn toolbars in Excel 007 Excel Discussion (Misc queries) 9 December 11th 04 02:02 PM


All times are GMT +1. The time now is 07:08 AM.

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

About Us

"It's about Microsoft Excel"