Need C# GUI Layout Advice

Posted on 2009-02-17
Last Modified: 2013-12-17
I have a search sidebar. When I search (for people) I want to display a list of items in the panel. Obviously, it has to scroll when the list becomes longer than the container.

Each item in the results list will take up one row.

Each item will comprise:
    an icon 32x32, left-aligned in the cell
    a line of bold black text, aligned at the top-left of the cell (but on the right of the icon)
    a line of gray text, aligned at the bottom left of the cell (but on the right of the icon)

What would be the best control to use?

ListBox will only show text
ListView will only show simple pictures and text (afaik)

I'm thinking about using a TableLayoutPanel, with a single column of cells. In each cell I will put another complicated table (or other container?) with images and labels formatted and aligned correctly.

(I also want to be able to select different types of preset view, e.g. no icon - just the bold text)

Will using a TableLayoutPanel make it difficult to give visual feedback on mouseOver? (I can't find an easy/elegant way to detect mouseOver a particular cell in a TableLayoutPanel)

Is there a better way?

Thanks for any advice.
Question by:as2003
    1 Comment
    LVL 96

    Accepted Solution

    I would think that you could attach a MouseOver event handler to the control, before you add it to the TableLayoutPanel.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, 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…

    737 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

    22 Experts available now in Live!

    Get 1:1 Help Now