Solved

Strange behaviour by selecting Large Icons from the Listview.

Posted on 2011-09-29
4
210 Views
Last Modified: 2013-12-17
Hi,

In picture1 (from Outlook) you see an image of a row that has been created in a listview
displayed in the Large Icon view. You see the icon is selected and the whole text is displayed.

In picure2 (my application) you see an image of a row that has been created in a listview
displayed in the Large Icon View. You see the icon is also selected BUT not the whole text
is displayed.

What can I do to get it like picture1, that the whole text is displayed?

Who knows the answer and is willing to help me?

Peter

private void tbNewNote_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmNote.lblTitle.Text = "";
            frmNote.rtbContent.Clear();
            frmNote.lblCreation.Text = (DateTime.Now.ToString());
            if (frmNote.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                ListViewItem myItem = new ListViewItem(frmNote.lblTitle.Text, 0);
                myItem = lvNotes.Items.Add(myItem);
                myItem.SubItems.Add(frmNote.rtbContent.Text);
                myItem.SubItems.Add(frmNote.lblCreation.Text);
                myItem.Selected = true;
            }
        }

Open in new window

Picture1.jpg
Picture2.jpg
0
Comment
Question by:peterkiers
  • 2
4 Comments
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 36813153
Check the MSDN documentation for the ListView.TileSize property:

http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.tilesize.aspx#Y0

Hope that helps.
0
 
LVL 1

Author Comment

by:peterkiers
ID: 36813172
It has nothing to do with the TileSize.

Peter
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 36813494
Outlook use a COM ListView, possibly a custom ListView, and although the result is similar, it does not have the same characteristics as the .NET ListView. Unfortunately for you, the .NET ListView does not have the possibility of setting the size.

Your easiest solution would be to use a smaller Font, but how small is small???

An alternative would be to set the OwnerDraw property to True and draw the thing yourself. This is quite involved however. Just give a look at the sample code for ListView.OwnerDrawn in the documentation.

Another alternative, that might end up being the best one, would be to use a FlowLayoutPanel with a UserControl. The UserControl would provide a PictureBox and a TextBox for which you can set the size, and the FlowLayoutPanel would simplify the positionning on the screen.
0
 
LVL 1

Author Comment

by:peterkiers
ID: 36813501
Thanks for the info.

Peter
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now