PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
about inherits custom control
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
about inherits custom control
![]() |
about inherits custom control |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
hi all
i am trying to make a custom control in specify a button with an image so i have googled around finding the good article on MSDN where it is explain how to make a control which behaves like a button (http://msdn2.microsoft.com/en-us/library/aa446518.aspx).. this custom controls inherits from Control and override the onPaint methods...this is good but this is quite more like an image that you can click.. iìd like to have a button with an image over it but with the shape of the button..so i have changed the code inheriting from Button... but in this way i can see that the onPaint event never fires..so the code which calls the drawing logic never executes i hope i am clear |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi,
In your OnPaint overrited method, did you call the OnPaint method of your mother class ? protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); // Your code } BR Fabien Decret Windows Embedded Consultant ADENEO (ADESET) http://www.adeneo.adetelgroup.com/ On 6 mar, 15:28, bule <b...@discussions.microsoft.com> wrote: > hi all > i am trying to make a custom control in specify a button with an image > so i have googled around finding the good article on MSDN where it is > explain how to make a control which behaves like a button > (http://msdn2.microsoft.com/en-us/library/aa446518.aspx).. > this custom controls inherits from Control > and override the onPaint methods...this is good but this is quite more like > an image that you can click.. > > iìd like to have a button with an image over it but with the shape of the > button..so i have changed the code inheriting from Button... > but in this way i can see that the onPaint event never fires..so the code > which calls the drawing logic never executes > > i hope i am clear |
|
|
|
#3 |
|
Guest
Posts: n/a
|
yes i call it, and as a matter of fact if i inherits from the generic class
Control all work, only if i inherits from the class Button the event doesn't fire... "Fabien" wrote: > Hi, > > In your OnPaint overrited method, did you call the OnPaint method of > your mother class ? > > protected override void OnPaint(PaintEventArgs e) > { > base.OnPaint(e); > // Your code > } > > BR > > Fabien Decret > Windows Embedded Consultant > > ADENEO (ADESET) > http://www.adeneo.adetelgroup.com/ > > > > > On 6 mar, 15:28, bule <b...@discussions.microsoft.com> wrote: > > hi all > > i am trying to make a custom control in specify a button with an image > > so i have googled around finding the good article on MSDN where it is > > explain how to make a control which behaves like a button > > (http://msdn2.microsoft.com/en-us/library/aa446518.aspx).. > > this custom controls inherits from Control > > and override the onPaint methods...this is good but this is quite more like > > an image that you can click.. > > > > iìd like to have a button with an image over it but with the shape of the > > button..so i have changed the code inheriting from Button... > > but in this way i can see that the onPaint event never fires..so the code > > which calls the drawing logic never executes > > > > i hope i am clear > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

