Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a command button picture be stretched?

Status
Not open for further replies.

GlennJames

Technical User
Mar 1, 2004
7
GB
Hi. I need your help! My application uses pictures on command buttons (to look like icons). The programme has also been designed to display in full screen between resolutions of 800x600 and 1600x1200 (the form resize event handles the resizing of frames, fontsizes, etc). At the moment, the programme includes several sets of similar pictures for use on the command buttons - one set of pictures for each possible screen resolution.

My question is... how can I get VB to resize command button pictures so that I only need to include one set of pictures in the application? Thanks. Glenn
 

Welcome to TT GlennJames. To get the most from these forums please read FAQ222-2244.

Yes it is possible to accomplish what you want several different ways. Some are easy and some can be nightmarish in there complexity.

One of the easier ways is to use a couple of picture boxes and the BitBlt API(or paintpicture) and do your resizing between the two picture boxes (hidden) and then do Command1.Picture1 = Picture2.Picture.

Good Luck

 
Hi vb5prgrmr.... thanks for your suggestion. I've tried various wasy to achieve what I want... including BitBlt and BitStretch API's .. plus PaintPicture. None of these methods appear to enable me to transfer the contents of a resized picture into the picture property of a command button! I'm getting really stuck for ideas. Or maybe I'm missing something really simple! Any more ideas? Thanks... Glenn.
 

Are you sure you have their styles set to graphical?

Good Luck

 
>None of these methods appear to enable me to transfer the contents of a resized picture into the picture property of a command button!

Quite. So resize them in a picturebox, then transfer the contents of the picturebox to the command button
 

Hmmm... Good Morning strongm, I take it the little one has kept you up all night?

GlennJames, also check the UseMaskColor property.

Good Luck

 
Ah no. I'm in the UK, so different time zone. Now he is keeping me up...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top