Results 1 to 2 of 2

Thread: [2005] Custom Buttons

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    331

    [2005] Custom Buttons

    Hey guys, I have created a good button layout in photoshop, but how would I use it in my program? I do not want to always add the picture box, so is there some kind of code there is so that everytime I add a button, it will be automatically skinned with my textures? Like in this picture:

    http://www.durosoft.com/DuroBlend-Final-Preview1.jpg

    See how his buttons are skinned? How do you do that?
    Katya Chehova is best!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] Custom Buttons

    You have to define your own class that inherits Button, handle its painting code to use your image, then use that control instead of regular Buttons in your applications. You would normally compile your class, along with any other custom controls you've created, into a library. You can then add the controls contained in that library to your Toolbox and then add them to your forms at design time just like the standard controls. There is information on MSDN about authoring your own controls.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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