|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Aligning a picture in the button control.Hello,
I am trying to add a picture to my button, but the picture always places itself right smack in the middle, while I want to place it to the left of the text. Is is possible to pull this off with the standard button control? If not, what are some of the alternatives (both commercial and free) that I can use. Preferably, these alternatives would be able to accept high-color images (ico, gif, png, etc...). Thanks > I am trying to add a picture to my button, but the picture always places Here's a solution I came up with a couple of years ago for this, it's a bit messy and can be cleaned up but the principle works:> itself right smack in the middle, while I want to place it to the left > of the text. > > Is is possible to pull this off with the standard button control? > If not, what are some of the alternatives (both commercial and free) > that I can use. Preferably, these alternatives would be able to accept > high-color images (ico, gif, png, etc...). http://groups.google.co.uk/group/microsoft.public.vb.winapi/browse_thread/thread/d83ebbe861138f44/85a9b70479f6a4be Hope this helps, Mike - Microsoft Visual Basic MVP - E-Mail: ED***@mvps.org WWW: Http://EDais.mvps.org/ "Frank Rizzo" <fri***@notn.com> wrote in message This may help... but requires subclassing... Mike's code'll probably be more news:%23NH$re4VFHA.3044@TK2MSFTNGP10.phx.gbl... > Hello, > > I am trying to add a picture to my button, but the picture always places > itself right smack in the middle, while I want to place it to the left of > the text. straight forward. Drawing Buttons, Option Boxes and Check Boxes In Your Own Style http://www.vbaccelerator.com/home/VB/Code/Libraries/Subclassing/Owner_Draw_Buttons/article.asp Make sure you get the subclasser shown in the 'Related' section. It's great to have anyway. -- Ken Halter - MS-MVP-VB - http://www.vbsight.com DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm Sign up now to help keep VB support alive - http://classicvb.org/petition Please keep all discussions in the groups.. Frank
The simplest way to do what you want would be to make a bitmap or icon that has both your icon and the required text, you would of course need a second disabled bitmap if the button was ever to be disabled. Dave Show quote "Frank Rizzo" <fri***@notn.com> wrote in message news:%23NH$re4VFHA.3044@TK2MSFTNGP10.phx.gbl... > Hello, > > I am trying to add a picture to my button, but the picture always places > itself right smack in the middle, while I want to place it to the left of > the text. > > Is is possible to pull this off with the standard button control? > If not, what are some of the alternatives (both commercial and free) that > I can use. Preferably, these alternatives would be able to accept > high-color images (ico, gif, png, etc...). > > Thanks |
|||||||||||||||||||||||