not another set of buttons you might say. actually i developed these buttons for a pos app a while back and finally got round to posting them.

the buttons are simple to use with all properties you need to set in the favourites tab.

ofontname - the name of the font to use
lshowbell - this gives a bell shape to the gradient. basically it changes the style of the button. see the image below.

nbuttoncolour1
nbuttoncolour2 - the 2 colours that will be used for the button when
nbuttontype = 4. use the colour picker to change these.

nbuttontype - there are 4 pre defined colours but you can add your own :
0 - black/grey
1 -  blue
2 - orange
3 - green
4 - uses the custom colours you set.

nfontcolour & nfontsize are self explanatory.

for all colours use the colour picker to change these.

here is the sample form with the buttons as they would look with the different options.



these buttons give visual feedback to the user. the colour gradient is flipped when the mouse moves over them. also if the button is clicked, there is slight movement so the user knows that the button was clicked.

important note: you need the system.app of the gdi+x from codeplex. however i have included a modified version of the gdiplus.vcx class that should be used with these buttons.

in fact it would be better if you used this class instead of the one from codeplex as it solves a problem with that class.

if there are many buttons placed on a form then when the form first displays, you see a rectangle and "x" where each button is before the buttons are drawn. with the class included in the download this problem does not exist since the form is only displayed after all buttons are drawn so you never see any "x"

enjoy.

Download

6 Responses to Ultra Simple Buttons with GDI+X

  • Dan says:

    Cool. Just wanted to say thanks for sharing.

  • Elmer Alexander says:

    Se ven muy bien pero tarda un poco en cargarlos y se ve un parpadeo me gustaria en lo posible si pudieras diseñar unos botones parecidos a los de ThemedControls con ese efecto

  • Miguel says:

    “The buttons look good but they take a while to load and you can see a blink. If possible, I would like you to design some buttons with an effect similar to that of ThemedControls.”

    As I already mentioned in my blog, it is better to use the gdiplus.vcx I supplied instead of the VFPX one. Please use that one and then see.

  • Hell Angel says:

    nice … unfortunately there are few things that quite disturbing, because you are using the image control, we can not use the focus and simply pressing the enter key instead of using mouse clicks. because users often do not like using too many mouse clicks.

    You can if you add a button (hidden) to the class. There always is a way.

  • Frederikus Boelema says:

    Hi, great buttons. only have 2 problems with them. The caption will not be dynamicaly changed, only with a mouseover the cption changes and I also use a resize control on the form which doesnot resize the buttons. only with a mouseover they will be come bigger.

    do you have some ideas ?
    thanks in advance
    Best regards
    Frederikus Boelema
    Holland

    • Bernard Bout says:

      You need to call the class.Draw() method if you change anything so the button can be redrawn. Resizing of buttons on Form Resize is NOT something that is EVER done in Windows. Looks ugly and not needed ever.

Leave a Reply

Your email address will not be published. Required fields are marked *