Control.background image property

C

Cor Ligthert

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
 
H

Herfried K. Wagner [MVP]

C

Cor Ligthert

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
 
M

Michael Turner

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.
 
C

Cor Ligthert

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
 
C

Cor Ligthert

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
 
H

Herfried K. Wagner [MVP]

* "Michael Turner said:
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?
 
C

Cor Ligthert

Herfried,
Do you have the URL of this article at hand?

See his original message, however that is almost the same as the
backgroundimage property description from the datagrid.

Cor
 
H

Herfried K. Wagner [MVP]

* "Cor Ligthert said:
See his original message, however that is almost the same as the
backgroundimage property description from the datagrid.

ACK. I assumed that the OP was referring to a KB article showing how to
add a background image to a datagrid control.

Maybe ppsGrid fits the needs of the OP, but the website is in German:

<URL:http://home.arcor.de/oberprieler/sshots.htm>
 
M

Michael Turner

The part I want to show the background in the they darkgrey background, not
in the cells themselves. Does this make a difference?

Mike.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top