C# .NET Why does my inherited listview keep drawing in LargeIcon View ?? Because Microsoft is Evil!!

Posted by Bugz R us on Stack Overflow See other posts from Stack Overflow or by Bugz R us
Published on 2010-05-20T13:47:44Z Indexed on 2010/05/20 16:20 UTC
Read the original article Hit count: 183

Filed under:
|
|
|
|

I have a inherited Listview which standard has to be in Tile Mode. When using this control, the DrawItem gives e.bounds which are clearly bounds of largeIcon view ?? When debugging to check the view it is actually set to, it says it's in Tile view ?? Yet e.DrawText draws LargeIcon view ??

......... Edit: .................

This seems only to happen when the control is placed upon another usercontrol?

......... Edit 2: .................

It gets stranger ... When i add buttons next to the list to change the view at runtime, "Tile" is the same as "LargeIcon", and "List" view is the same as "SmallIcons" ??? I've also completely removed the ownerdraw ...

.......... Edit 3: .................

MSDN Documentation: Tile view

Each item appears as a full-sized icon with the item label and subitem information to the right of it. The subitem information that appears is specified by the application. This view is available only on Windows XP and the Windows Server 2003 family. On earlier operating systems, this value is ignored and the ListView control displays in the LargeIcon view.

Well I am on XP ya damn liars ?!? Apparently if the control is within a usercontrol, this value is ignored too ...

pff I'm getting enough of this Microsoft crap .... you just keep on hitting bugs ... another day down the drain ...

public class InheritedListView : ListView
{
    //Hiding members ... mwuahahahahaha   //yeah i was still laughing then
    [BrowsableAttribute(false)]
    public new View View
    {
        get { return base.View; }
    }

    public InheritedListView()
    { 
        base.View = View.Tile;

        this.OwnerDraw = true;
        base.DrawItem += new DrawListViewItemEventHandler(DualLineGrid_DrawItem);
    }

    void DualLineGrid_DrawItem(object sender, DrawListViewItemEventArgs e)
    {
        View v = this.View;

        //**when debugging, v is Tile, however e.DrawText() draws in LargeIcon mode,
        // e.Bounds also reflects LargeIcon mode ???? **
     }

© Stack Overflow or respective owner

Related posts about c#

Related posts about listview