|
-
Feb 22nd, 2000, 02:04 AM
#1
Thread Starter
New Member
Anyone know how to put a small icon in a command button on the left of the text instead of centering it?
-
Feb 22nd, 2000, 04:41 PM
#2
Hyperactive Member
Hi,
Hope you are using the graphical style command button right? Try adding the image and the text using the code instead of from the property sheet. I have not tried it as i dont have vb in my system, still i believe there must be some option for this.
Good Luck,
Thanks and Regards,
Venkat.
-
Feb 22nd, 2000, 06:10 PM
#3
You could try creating a little GIF or something with the icon positioned to the left and the grey button colour to the right and then stick that onto your button.
This would make the icon appear left aligned. You'd have to put your text in the GIF as well though as VB won't overlay a caption over a graphic.
Mafro
-
Feb 22nd, 2000, 08:32 PM
#4
Lively Member
One way of doing it is:
1 .Add a PictureBox with the required graphic.
2. Add your CommandButton with the required text.
3. Add spaces to the Caption of the CommandButton to allow for the graphic on the left hand side.
4. Put the PictureBox in the space you've created on the CommandButton. (Bring to front if necessary (CTRL-J).
Optional:
5. Add code to make the PictureBox move when the mouse button is pressed - so it looks like it's on the surface of the CommandButton instead of floating on top of it:
Eg: Picture1.Top = intPicture1YPos + intPixel
Picture1.Left = intPicture1XPos + intPixel
Where intPicture1XPos and intPicture1YPos are the original coordinates of the PictureBox and intPixel is Screen.TwipsPerPixelX (probably 15)
-
Feb 22nd, 2000, 10:07 PM
#5
Lively Member
Then there's the easy way. All you have to do is open your component list (right click on toolbox, select Components) and select Microsoft Forms 2.0 Object Library. It will put a couple of controls on your toolbox, of wich one is a button. This button allows you to specify where you want the picture.
Simple
Today is yesterday's tomorrow
-
Feb 22nd, 2000, 11:41 PM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|