Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Strange behaviour by selecting Large Icons from the Listview.

Posted on 2011-09-29
4
Medium Priority
?
218 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 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