Solved

Strange behaviour by selecting Large Icons from the Listview.

Posted on 2011-09-29
4
213 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 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