Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Filling command button with image

My Excel 97 - Excel 2003 program creates a small Forms.CommandButton on
worksheets. The command button has no caption but I want to fill as much of
the button face with an image as possible.

I use code like the following:

myBtn.Object.Picture = LoadPicture("myImage.gif")

I've tried creating the image as a GIF, BMP or JPG and I always get the same
result ... a small image centered within the button. I can't fill the whole
button face with the image the way I want.

I've tried setting PicturePosition = fmPicturePositionCenter and that
doesn't help. I've also tried setting PictureSizeMode but that property
doesn't seem to be supported.

Any suggestions?

TIA,

josh


  #2   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default Filling command button with image

HI JOsh

I tired this with various files and got both satisfactory results (ie button
filled) and also duplicated your result.

It appears to be to be a fubction of size of the imported picture as to
wheter or not it has the capability of filling the button.

For example a 27KB bit map impage failed to fuill the button ; remaining
central and small even with adjustment of the properties.

Hope this helps

N10

"Josh Sale" <jsale@tril dot cod wrote in message
...
My Excel 97 - Excel 2003 program creates a small Forms.CommandButton on
worksheets. The command button has no caption but I want to fill as much
of the button face with an image as possible.

I use code like the following:

myBtn.Object.Picture = LoadPicture("myImage.gif")

I've tried creating the image as a GIF, BMP or JPG and I always get the
same result ... a small image centered within the button. I can't fill
the whole button face with the image the way I want.

I've tried setting PicturePosition = fmPicturePositionCenter and that
doesn't help. I've also tried setting PictureSizeMode but that property
doesn't seem to be supported.

Any suggestions?

TIA,

josh



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.772 / Virus Database: 519 - Release Date: 01/10/2004


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Filling command button with image

N10,

I appreciate your response and am glad to hear that at least some of the
time you were able to reproduce my result.

However, I still don't understand what the "rules" are to achieve success.

Did you notice any patterns?

josh



"N10" wrote in message
...
HI JOsh

I tired this with various files and got both satisfactory results (ie
button filled) and also duplicated your result.

It appears to be to be a fubction of size of the imported picture as to
wheter or not it has the capability of filling the button.

For example a 27KB bit map impage failed to fuill the button ; remaining
central and small even with adjustment of the properties.

Hope this helps

N10



  #4   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default Filling command button with image

Hi JOsh

I didnt replicate it exhastively I will leave that you now that you know
size of input file may be a factor.

Try saving your image file in different sizes and notice how that effects
import size and reaction to porperty commands. Any photo enditor will allow
you to do this.

Best N10

"Josh Sale" <jsale@tril dot cod wrote in message
...
N10,

I appreciate your response and am glad to hear that at least some of the
time you were able to reproduce my result.

However, I still don't understand what the "rules" are to achieve success.

Did you notice any patterns?

josh



"N10" wrote in message
...
HI JOsh

I tired this with various files and got both satisfactory results (ie
button filled) and also duplicated your result.

It appears to be to be a fubction of size of the imported picture as to
wheter or not it has the capability of filling the button.

For example a 27KB bit map impage failed to fuill the button ; remaining
central and small even with adjustment of the properties.

Hope this helps

N10





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.772 / Virus Database: 519 - Release Date: 01/10/2004


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Filling command button with image

What file format did you save your image in (bmp, gif, jpg, etc)?


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
Change button image juanperez Excel Discussion (Misc queries) 0 February 5th 09 04:49 PM
Paste Button Image Sarah at DaVita Excel Discussion (Misc queries) 2 June 1st 07 08:46 PM
Form-filling application with Excel (background image)? J.Smith Excel Discussion (Misc queries) 1 May 15th 05 08:40 AM
Extract image from toolbar button jamieuk Excel Programming 1 January 16th 04 03:23 PM
upload a button image Oliver Chiu Excel Programming 3 July 17th 03 07:33 PM


All times are GMT +1. The time now is 03:06 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"