Archived

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

How to custome our own button in VB?

This topic is 5620 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

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
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