Solved

Strange behaviour by selecting Large Icons from the Listview.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

919 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

14 Experts available now in Live!

Get 1:1 Help Now