Solved

Strange behaviour by selecting Large Icons from the Listview.

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

729 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