| Author |
Code to change button style?
|
|
| Lisa Forde 2005-11-25, 7:55 am |
| Good day. I want to be able to change my button from just having text to
having an image at runtime and I'm wondering if anyone has come across code
to do this. It would be much appreciated.
Thanks
| |
|
| VB button style property is read-only at runtime. So you have to set your vb
button style to graphical at design time...
Then use loadpicture command to assign a picture to the button
Command1.Picture = LoadPicture("c:\yourpicture.bmp")
"Lisa Forde" <1forde@caribsurf.com> wrote in message
news:11odtmjb7rbvae0@corp.supernews.com...
> Good day. I want to be able to change my button from just having text to
> having an image at runtime and I'm wondering if anyone has come across
code
> to do this. It would be much appreciated.
>
> Thanks
>
>
| |
| Lisa Forde 2005-11-25, 6:55 pm |
| Perfect Mr. O. Thanks. I really have a lot to learn.
"Joe O" <jp3BlessNoSpam@hotmail.com> wrote in message
news:%23oP51Uc8FHA.1484@tk2msftngp13.phx.gbl...
> VB button style property is read-only at runtime. So you have to set your
> vb
> button style to graphical at design time...
> Then use loadpicture command to assign a picture to the button
>
> Command1.Picture = LoadPicture("c:\yourpicture.bmp")
>
> "Lisa Forde" <1forde@caribsurf.com> wrote in message
> news:11odtmjb7rbvae0@corp.supernews.com...
> code
>
>
| |
|
| If I really needed to change the style at runtime I would set up two buttons,
one with text and one with Graphic.
maybe it's even possible to do as a control array.
Place both on top of each other, use .Visible to control which to use.
Kjell
"Lisa Forde" wrote:
> Perfect Mr. O. Thanks. I really have a lot to learn.
>
> "Joe O" <jp3BlessNoSpam@hotmail.com> wrote in message
> news:%23oP51Uc8FHA.1484@tk2msftngp13.phx.gbl...
>
>
>
|
|
|
|