Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

johnc82

How to custome our own button in VB?

This topic is 5926 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi... Anyone know or got any information on how to build or make your own type and shape of button in visual basic 6.0? Thanks :-)

Share this post


Link to post
Share on other sites
Advertisement
You could just cheat and use and image as a button, and you can make the image change when it is clicked to give the impression of a real button.

Share this post


Link to post
Share on other sites
Try to IMPLEMENT the button class and then overwrite the gui, or build a button class by using lines in the gdi and write your own click events, etc then instantiate your object with events.

Or if you are rendering the button write it in your engine class and then write your object with events. Just start coding, this is a very easy issue you are dealing with.

(events/raise events)

Private With Events udoButton

Set udoButton As New ButtonClass

Hell make it an OCX and add it to your toolbar, just be sure and make the class COM compliant.



Dreddnafious Maelstrom

"If i saw farther, it was because I stood on the shoulders of giants."

Sir Isaac Newton

Share this post


Link to post
Share on other sites
Theoretically, you could create a user control where you define the shape and redraw the button on mouse down and mouse up events, and raise an event defined in your user control for Click...


You know, I never wanted to be a programmer...

Alexandre Moura

Share this post


Link to post
Share on other sites
heres a tip for you try http://www.vbcode.com if theres anything I need to know on vb I go there and get some sample code and see how it works. They have loads of it by far the best on the web for all things vb related.

Share this post


Link to post
Share on other sites
Oh and the quickest way here would be to do what coin said and you could use the mask option to make the back ground invisible.

Share this post


Link to post
Share on other sites
im not sure if u can implement components.

In VB, u can use practically anything as a button, as most things have mouse events. if you are concerned with keeping your code clean, and on-topic(something VB programmers need a lesson in, apparently), you should create a user-control.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!