|
-
Nov 2nd, 2000, 06:30 PM
#1
Thread Starter
Hyperactive Member
Hey, many programs have command buttons that have IMAGES to the VERY left of the command button
simple 16x16..
these are not imageboxes ontop of the button, because the image moves with the button, and etc.
The image stays to teh VERY LEFT of the command button and text goes to the right
does anyone know how this is done and/or have an ocx? thanks
-
Nov 2nd, 2000, 06:36 PM
#2
You can use Images for it. Just make 2 states of it; a pressed state and an unpressed state. then you can change the images on the MouseDown and MouseUp event of the main image.
-
Nov 2nd, 2000, 06:45 PM
#3
Frenzied Member
Or...
You can include the text as part of the image. And the standard button control has a DownPicture property and a DisabledPicture property that you can set, so you dont have to worry about mouse down and mouse up events.
-
Nov 2nd, 2000, 07:23 PM
#4
Thread Starter
Hyperactive Member
No no no!
the text is NO IMAGE at all!
The only image is the one on the left.. that icon NEVER moves, and the text is "focused" to the right of the button
and will never hit the icon
So it is its own BUTTON
its like this
_____________
| % HELLO |
-------------
% = Icon
and HELLO is the text
its amazing to me that NO ONE i have ever asked, knows about this stuff.
-
Nov 2nd, 2000, 08:34 PM
#5
PowerPoster
..
I'm still trying to figure out how to make an image Pressed and upressed?? Do you do it in ms paint or something??
-
Nov 3rd, 2000, 01:51 PM
#6
Frenzied Member
Uhh, progeix, what i said was that the text could be part of the image, which means you create an image (your 16x16 icon) and put some text next to it in the same bitmap. Of course you also set the butons caption to nothing ("").
If you add this bitmap to the command button, it will look like your "drawing". If you want the text to appear centered on the button with the icon to the left of it, draw the icon, put the text to the right of it, and then leave some space (the width of your icon) to the right of the text.
You also need to make a background color for your bitmap one that you aren't using in your icon or text. Then set this color to the CommandButton's MaskColor property and set the CommandButton's UseMask property to true. This will give you a transparent background to your image, so all you see is the icon and text.
By the way, in your first post you said:
these are not imageboxes ontop of the button, because the image moves with the button
In your next post you said:
The only image is the one on the left.. that icon NEVER moves
You seem to be contradicting yourself.
Lethal, you can create images in MSPaint. If you want the image to change when the button is pressed, open the "non-pressed" image, make whatever changes you want to it, then save it under a different name. Then assign the first image to the CommandButton's Picture property, and the second (pressed) image to the CommandButton's DownPicture property. Likewise, if you want a different picture when the button is diabled (usually the same picture only "greyed out") then create another MSPaint file and assign it to the CommandButton's DisabledPicture property.
-
Nov 3rd, 2000, 04:00 PM
#7
Hyperactive Member
Hey, is it just me or progeix just had a bad day?
-
Nov 3rd, 2000, 05:04 PM
#8
Frenzied Member
sounds like a bad day to me
progeix, I'm sending you a quick example of how to do a graphic and text in an image on a command button.
One noticeable limitation of my implementation, however, is that you have no control over the text color for the button caption. If you user is using a system color other than the one set in your graphic, your buttons that use system colors will appear different than the ones that use graphics. (You may notice that in the example I sent you since my button caption system color is not black).
Hope that helps clear things up a little
[Edited by seaweed on 11-03-2000 at 05:23 PM]
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
|