Buttons and bitmaps. [RESOLVED]

vis781

Well-known member
Joined
Aug 30, 2005
Messages
2,016
Location
Cambridge, UK
Programming Experience
5-10
Hi again, thanks to everyone who helped me out on then last query but i'm afraid since then i have another....

I'm looking to create my own button controls is the best way to do this just to override the paint event of the button, and would that give me the sharp finish that i'm after. I've heard that you have use bitmap images and make them into buttons however i wouldn't know where to start.

anyone out there who can help?
 
Last edited:
If u're still lookin at how to write ur own I can help since I have implemented very rich set of buttons very recently, though I cannot share those code with u, I can guide u through how to do it.
Let me know if you're still looking forward on this matter
 
Simply I can guide through u with code segments. What I meant was I cannot share the same code base I used since it is developped for commercial product, and it is illegal to do so.
 
I'll be back with more detailed information + code segments (something similar to tutorial - I need few days for that) explaining how to do it
 
I would real y appreciate absolutely any help you could give me in this matter. Since posting this query i have tried many times to successfully create a button however my attemps seem to fail and i can't see why. So yes i would love for you to help me.

All i want to do is be able to create some better looking buttons for my application, just so it simply looks better. i don't know how to be any clearer, i guess what i'm asking is ... what makes a button a button.
 
Last edited:
OK, take a look at the attached project below :)

buttons.png


HTH

Regards ;)
 

Attachments

  • ButtonImage.zip
    51.1 KB · Views: 76
Yea thats the kind of thing that i'm after, however what is really causing me a headache is how you give the button the appearance of being pressed. Does this mean that you need two or more image frames in your user control and then you siwtch to a differnt image based on user action or am i missing the point totally here. and properties!!?!!! ok it inherits the properties from the button object but what if i want to add more?
 
Well, to be honest i'm using custom button every time i need something like mouseEnter -mouseLeave effect. Namely, i'm overriding onMouseHEnter and onMouseLeave plus adding additional properties that allows user (me in this case) to select an image for each state respectively in design view. The project above is using just like you said a different image for both state. So, start PS or any other image editor you like, make some pictures (buttons) and add say one to the mouseEnter and another (with a different color, shadow, blur or any other effects) to the mouseLeave event. That's it!!!

Regards ;)
 
ok, thanks for all the help. I'll give it a try and if i come up with anything special i post the source for you to have a look at. Cheers again.
 
Code

Hi Sorry for the delay, couldn't find enough time but finally I ripped most of the rich functionality keeping code understandable and with basic functionality and as u requested illustrating how to have the button down state and all...I removed lot of functionality and rich features and wanted to illustrate basic implementaionof most required options. Purposely removed how to how odd shape buttons, handling non rectangleregion buttons .. colorizing and many many more features... I thing you guys can think and implentany if required... and ask for the help if neededPut enough comments in the code so that anyone can understandonce again sorry for the delay!!thanks
 

Attachments

  • MyButton.zip
    7.2 KB · Views: 60
Back
Top