468,119 Members | 1,912 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,119 developers. It's quick & easy.

Control.background image property

Anyone know how to make use of this?
http://msdn.microsoft.com/library/de...ImageTopic.asp

I cant seem to work out what to do.
Thanks Mike.

Nov 21 '05 #1
7 1158
Michael,

The control class is the base class of all controls including forms.

This property you find in all controls.(because the inherit from it)

Therefore you can do not have to cast to individual controls when you have
by instance an event that is for all controls.

Than you can do.
directcast(sender,control).backgroundimage = image.imagefromfile("blabla")

Watch that this is for a windowform control and not a web.ui.control

I hope this helps?

Cor

"Michael Turner" <fi*****@m-turner.co.uk> schreef in bericht
news:Oh**************@TK2MSFTNGP09.phx.gbl...
Anyone know how to make use of this?
http://msdn.microsoft.com/library/de...ImageTopic.asp
I cant seem to work out what to do.
Thanks Mike.

Nov 21 '05 #2
* "Michael Turner" <fi*****@m-turner.co.uk> scripsit:
Anyone know how to make use of this?
http://msdn.microsoft.com/library/de...ImageTopic.asp

I cant seem to work out what to do.


What doesn't work? Are you trying to assign a background image to a
control? Notice that all controls inherit this property, but some
controls do not implement it, so setting the background image doesn't
cause an image to be displayed in the background for all controls.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
Herfried,

I was looking for a text, I think you found the right one. I added an extra
sentence for it.

Notice that all controls inherit this property, but some
controls do not implement it, so setting the background image doesn't
cause an image to be displayed in the background for all controls.

What is for more properties which are inherited, while some properties are
in some controls overidden, by instance Text.

Cor
Nov 21 '05 #4
I am trying to change the gackground image of a DataGrid and was pointed to
this article by MSDN, I have tried what you suggested but the background
image still does not appear.
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Michael,

The control class is the base class of all controls including forms.

This property you find in all controls.(because the inherit from it)

Therefore you can do not have to cast to individual controls when you have
by instance an event that is for all controls.

Than you can do.
directcast(sender,control).backgroundimage = image.imagefromfile("blabla")

Watch that this is for a windowform control and not a web.ui.control

I hope this helps?

Cor

"Michael Turner" <fi*****@m-turner.co.uk> schreef in bericht
news:Oh**************@TK2MSFTNGP09.phx.gbl...
Anyone know how to make use of this?

http://msdn.microsoft.com/library/de...ImageTopic.asp

I cant seem to work out what to do.
Thanks Mike.



Nov 21 '05 #5
Michael,

See the text Herfried, added and to what I again addes something.
What you try to do is nothing the way, when you cannot do it using the
datagrid itself, you cannot do it using the class it derives it from.

It is an overridable property so you can do your own code, however I did not
see a sample on Google for that, what is mostly when it is easy.

Cor
Nov 21 '05 #6
Michael,

I cannot understand my own message, I was in a very hurry when I wrote it.

Here a corrected text.
----------------------------------------
See the text that Herfried has added and to what I again added something.

It is an overridable property so you can do your own code in your own
inherrited datagrid class, however I did not see any sample on Google for
that, what is mostly when it is easy.

Cor
Nov 21 '05 #7
* "Michael Turner" <fi*****@m-turner.co.uk> scripsit:
I am trying to change the gackground image of a DataGrid and was pointed to
this article by MSDN, I have tried what you suggested but the background
image still does not appear.


Do you have the URL of this article at hand?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.