Picture or text in a button control
-
Hi ! I'm a beginner with VB 6.0, trying to use it for a GUI, because I heared it's the best choice for that. But, actually, I'm facing some problems I thought I would never have to worry with VB. Here is my problem : I want to display a Button. This button should be able to display a text OR a picture, depending on the user's choice. I also want the picture to be resized according to the button size. Doing that, I read in the help that the Sytle property of a button, choosing the appearance to be text or picture, cannot be changed during runtime. Well, then I thought I would just put an 'Image' Control, on top of my button. This Image control would be visible when an image has to be displayed on the button, and would not be visible when the normal text on the button has to be displayed. BUT, it seems I just cannot put the Image Control in front of the button, it always stays on the back !!! Anyone could help me with that ? Thank you ! Jerome
-
Hi ! I'm a beginner with VB 6.0, trying to use it for a GUI, because I heared it's the best choice for that. But, actually, I'm facing some problems I thought I would never have to worry with VB. Here is my problem : I want to display a Button. This button should be able to display a text OR a picture, depending on the user's choice. I also want the picture to be resized according to the button size. Doing that, I read in the help that the Sytle property of a button, choosing the appearance to be text or picture, cannot be changed during runtime. Well, then I thought I would just put an 'Image' Control, on top of my button. This Image control would be visible when an image has to be displayed on the button, and would not be visible when the normal text on the button has to be displayed. BUT, it seems I just cannot put the Image Control in front of the button, it always stays on the back !!! Anyone could help me with that ? Thank you ! Jerome
If you are still stuck you could do something like this: 1. Create two buttons, one with an image, the other with text 2. Stack the two buttons on top of each other 3. Use the ZOrder property of each button to control which button is on top(visible) Hope this helps. Nick Parker