How to expose the Image-Size-Property of an ImageList in a User Control?

J

Jan Liße

Hallo,
I've got a user control containing an ImageList and I want to enable
the user of my control to change the size of the Images stored
in the ImageList during design-time. Any suggestions how I can manage this?
Thanks in advance,
Jan
 
H

Herfried K. Wagner [MVP]

* "Jan Liße said:
I've got a user control containing an ImageList and I want to enable
the user of my control to change the size of the Images stored
in the ImageList during design-time. Any suggestions how I can manage this?

Add two properties for the size (or a property of type 'Size') which set
the size of the images in the list.
 
J

Jan Liße

I still have a question.
In the class of my control i declared in the header of my class: "private
Size UserdefinedSize"
and I added the property:
----------------------------------------------------------------------------
------------------
public Size UserdefinedSize
{
get
{
return UserDefinedSize;
}
set
{
UserDefinedSize = value;
}
}
----------------------------------------------------------------------------
--------------------

I think it is ok so far. But i am not sure how to set this property now for
my ImageList.ImageSize...
I tried: "myImageList1.ImageSize = UserdefinedSize" in the constructor of my
class but that leads to build-errors (class already contains a definition of
"UserDefinedSize")!
 

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