Results 1 to 4 of 4

Thread: Use picture as a command button?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    13

    Use picture as a command button?

    Is it possible to use an image as a command button? I have a few command buttons on my form and don't really like the boring look of the default buttons. Id like to be able to design my own button to use, any ideas?
    Bryan

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    You could use the Graphical style of the standard command button.
    You can assign an image to the button.

    You could use a picturebox with a up picture and when the pic is
    clicked you can change it to a down image. Not quite that simple,
    but that would be the logic.

    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Hyperactive Member wiccaan's Avatar
    Join Date
    Apr 2004
    Location
    127.0.0.1
    Posts
    475
    Or you can just do:

    Code:
    Private Sub Image1_Click()
    'Code Here
    End Sub
    But changing the graphics of a command button would be better, since commands buttons are made to do this.

    Then you can also change the images, MouseOver, MouseDown, MouseUp status' to do diffrent effects or show diffrent pics for each thing.
    If my post was helpful please rate it

  4. #4
    Addicted Member Abilio's Avatar
    Join Date
    May 2003
    Location
    Aveiro - Portugal
    Posts
    222
    Take a look at my submission on http://www.planetsourcecode.com/vb/s...20043545056452

    It will not be hard to implement what you are trying to do. Only need to change RECT for placing a picture in all the command button

Posting Permissions

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



Click Here to Expand Forum to Full Width