Consulting

Results 1 to 5 of 5

Thread: Button Image

  1. #1

    Button Image

    Hello all,

    I am having trouble finding out how to put an image on a button. So far I have created the button thusly:
    [vba]
    Dim ctrl As Button
    Set ctrl = Sh.Buttons.Add(20, 20, 20,20)
    ctrl.OnAction = "help"
    [/vba]

    but cannot find out how to put an image on it instead of text.

    Does anyone know how to do this?

    Thanks

  2. #2
    VBAX Tutor
    Joined
    Jun 2012
    Posts
    269
    Location
    If you are talking about putting an image on a command button, you can simply go into the properties and scroll down to picture then click the little ... and browse your hard drive and load an image.

  3. #3
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Insert a Picture instead.

  4. #4
    Quote Originally Posted by CodeNinja
    If you are talking about putting an image on a command button, you can simply go into the properties and scroll down to picture then click the little ... and browse your hard drive and load an image.
    Thanks for this but I should have said I'm trying to programatically change the image!!

  5. #5
    VBAX Tutor
    Joined
    Jun 2012
    Posts
    269
    Location
    Cosmarchy,
    OH!!!! you want to load it with vba... ok... you want:

    Commandbutton.picture = loadpicture(path)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •