Home All Groups Group Topic Archive Search About

Inherit or usercontrol

Author
31 Mar 2005 7:24 AM
Station Media
Hi everybody,

I need to create a custom button for all our internal applications, and i
would like to know what is the best for this type of control(button), is it
to inherit standard button or create a full new one with usercontrol (using
GDI+) ?
Which one will be the fatest or is it the same speed to display button on
screen (form with more than 100 buttons) ?

thank you
jean-claude

Author
31 Mar 2005 7:32 AM
Cor Ligthert
Jean,

Most probably is every control that you inherit from another slower.

Everywhere when there is GDI+ involved it will be extra slow.
(By instance round ones).

Cor
Author
31 Mar 2005 9:28 AM
Phill. W
"Station Media" <goo***@easycolorthemes.com> wrote in message
news:5cdcc037.0503302324.44371eb7@posting.google.com...
> I need to create a custom button for all our internal applications,
> and i would like to know what is the best for this type of control
> (button), is it to inherit standard button or create a full new one
> with usercontrol (using GDI+) ?

I don't know /much/ about GDI+, but I suspect that if you go down
that road, then you have to do absolutely /everything/, including
updating your control to incorporate any changes that Our Friends
in Redmond might want to introduce into future "Button" controls
(you can guarantee your Users will want all this new "stuff").

If you inherit from the standard button, I /think/ you can still take
charge of the drawing of that button (read up on OwnerDrawn
Controls - I've used this with TabPages, if not with Buttons).

> Which one will be the fastest or is it the same speed to display
> button on screen

The speed probably won't be that much different, once your control
has been loaded and J-I-T-compiled (more GDI+ code => longer
load time).

> (form with more than 100 buttons) ?

You have a form with 100 buttons???
What are you writing?  The next version of MineSweeper?  ;-)

HTH,
    Phill  W.

Show quoteHide quote
>
> thank you
> jean-claude
Author
31 Mar 2005 3:51 PM
Station Media
> The speed probably won't be that much different, once your control
> has been loaded and J-I-T-compiled (more GDI+ code => longer
> load time).
>
> > (form with more than 100 buttons) ?
>
> You have a form with 100 buttons???
> What are you writing?  The next version of MineSweeper?  ;-)
>
> HTH,
>     Phill  W.
>


Thank you for answer, no i'm not writing a minesweeper :-) just a user
interface which need many buttons on screen.

So to resume you say i should use original button and inherit it ? (i
need to paint new button style on each button, i think to use GDI+).

jean-claude