473,378 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

override Text but not Image

I've come across a bit of an annoyance i'm hoping someone can explain and/or
get me past.

I'm overriding the Text property on a user control i'm writing that inherits
from System.Windows.Forms.Button.
This works beautifully.
However, when i try to do the same thing for the Image property, i find it
won't let me override it.

Looking into the docs, it appears that the Text property is marked as
Virtual, whereas the Image property is not.
Is there any way around this?

Thanks in advance!

-Tim
Nov 16 '05 #1
4 1423
Can you do anything with the ImageList property I wonder ?

"Tim Mulholland" <Ti***********@nospamaddress.com> wrote in
news:O5**************@TK2MSFTNGP10.phx.gbl:
I've come across a bit of an annoyance i'm hoping someone can explain
and/or get me past.

I'm overriding the Text property on a user control i'm writing that
inherits from System.Windows.Forms.Button.
This works beautifully.
However, when i try to do the same thing for the Image property, i
find it won't let me override it.

Looking into the docs, it appears that the Text property is marked as
Virtual, whereas the Image property is not.
Is there any way around this?

Thanks in advance!

-Tim


Nov 16 '05 #2
none of the Image* things seem to be overridable as far as i can tell...

"Your_name" <df*@dkjdsf.com> wrote in message
news:Xn****************************@66.150.105.41. ..
Can you do anything with the ImageList property I wonder ?

"Tim Mulholland" <Ti***********@nospamaddress.com> wrote in
news:O5**************@TK2MSFTNGP10.phx.gbl:
I've come across a bit of an annoyance i'm hoping someone can explain
and/or get me past.

I'm overriding the Text property on a user control i'm writing that
inherits from System.Windows.Forms.Button.
This works beautifully.
However, when i try to do the same thing for the Image property, i
find it won't let me override it.

Looking into the docs, it appears that the Text property is marked as
Virtual, whereas the Image property is not.
Is there any way around this?

Thanks in advance!

-Tim

Nov 16 '05 #3
Hi Tim,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to override the Image property
of winform Button control. If there is any misunderstanding, please feel
free to let me know.

As far as I know, the Button.Image is inherited from ButtonBase.Image. It
is a non-virtual property, which means that it is not declared as either
abstract, virtual or override. So, based on C# language reference, it
cannot be inherited and it seem there is no workaround on this.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #4
that was definitely the conclusion i came to as well.
i just wanted to verify that this was the truth.

"Kevin Yu [MSFT]" wrote:
Hi Tim,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to override the Image property
of winform Button control. If there is any misunderstanding, please feel
free to let me know.

As far as I know, the Button.Image is inherited from ButtonBase.Image. It
is a non-virtual property, which means that it is not declared as either
abstract, virtual or override. So, based on C# language reference, it
cannot be inherited and it seem there is no workaround on this.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Bradbury | last post by:
I may be thinking about this the wrong way, but here goes: In my style sheet I've specified that bullet points should use a specific image rather than just be default bullet points. However, at...
3
by: Woodmon | last post by:
Example of my CSS follows: <style type="text/css" media="screen"> BODY { color: white } A:link { color: 66CCFF; } A:visited { color: CC66FF; } A:active { color: CC66FF; } A:hover {...
7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
5
by: Mark Broadbent | last post by:
Oh yes its that chestnut again! Ive gone over the following (http://www.yoda.arachsys.com/csharp/faq/ -thanks Jon!) again regarding this subject and performed a few of my own tests. I have two...
1
by: charliewest | last post by:
Using the .Net Compact Framework, how is it possible to override the SelectImageIndex property? I am trying to achieve the following: That when a user selects a node, or child-node, that the image...
3
by: Richard | last post by:
I have a requirement to put a GDI style circle or rectangle border around the selected row of a datagrid/ It will overlap into the row above and below the selected row. Doing this in a the OnPaint...
9
by: Richard | last post by:
Please hlep with a very frustrating problem. I need to be able to have a reference to my "btcopyrights" CSS class override the link colors first specified earlier in the CSS. I inherited a large...
1
by: Joshua | last post by:
I'm creating a web control that has an image and a text box. I would like to then override the Visible and Text property of the usercontrol, so when you reference the visible property of the user...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.