forms application in vc++.net doubt

  • Thread starter Thread starter Sanjeeva Reddy
  • Start date Start date
S

Sanjeeva Reddy

Hi,

I am new to VC dot net.

I shall be thakful if you can reply one of my query.
how to change the size of images in imagelist in listview control
vc++.net(forms application).

Thanks and Regards,
Sanjeev
 
Hi !

I'm assuming you're using .NET Framework, because you're using Windows
Forms. In that case, a ListView class has three properties called
LargeImageList, SmallImageList and StateImageList, each related to a
specific display mode of the ListView.

Each of these properties is an ImageList class. This class has ImageSize
property (type Size), that determines the size of the images in this image
collection. Changing this parameter determines the size of the images in the
list. Know that the images themselves are located in ImageList::Images
property, which is of ImageList::ImageCollection type.

Code examples are always the best, so here you go. This is a C++/CLI
example, because that language is much more flexible with .NET Framework
than Managed C++. The only thing this affects in the sample code is the
creation process of the System::Drawing::Size object. In Managed C++, this
is done in a different manner.

<code snip>

MyListView->SmallImageList->ImageSize = gcnew System::Drawing::Size( 200,
200 ); // Sets small image size to 200, 200
MyListView->LargeImageList->ImageSize = gcnew System::Drawing::Size(100,
100); // Sets large image size to 100, 100

</code snip>

Hope this helps

-Antti Keskinen
 

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

Back
Top