Beispiel #1
0
        public void ShowTiles(int[] columns)
        {
            ListViewAPI.LVTILEVIEWINFO apiTileView;
            ListViewAPI.LVTILEINFO     apiTile;

            IntPtr lpcol = Marshal.AllocHGlobal(columns.Length * 4);

            Marshal.Copy(columns, 0, lpcol, columns.Length);

            int param = 0;

            _apiRetVal = ListViewAPI.SendMessage(this.Handle, ListViewAPI.LVM_SETVIEW, ListViewAPI.LV_VIEW_TILE, ref param);

            apiTileView         = new ListViewAPI.LVTILEVIEWINFO();
            apiTileView.cbSize  = Marshal.SizeOf(typeof(ListViewAPI.LVTILEVIEWINFO));
            apiTileView.dwMask  = ListViewAPI.LVTVIM_COLUMNS | ListViewAPI.LVTVIM_TILESIZE;
            apiTileView.dwFlags = ListViewAPI.LVTVIF_AUTOSIZE;
            apiTileView.cLines  = columns.Length;


            _apiRetVal = ListViewAPI.SendMessage(this.Handle, ListViewAPI.LVM_SETTILEVIEWINFO, 0, ref apiTileView);

            foreach (XPListViewItem itm in this.Items)
            {
                apiTile           = new ListViewAPI.LVTILEINFO();
                apiTile.cbSize    = Marshal.SizeOf(typeof(ListViewAPI.LVTILEINFO));
                apiTile.iItem     = itm.Index;
                apiTile.cColumns  = columns.Length;
                apiTile.puColumns = (int)lpcol;

                _apiRetVal = ListViewAPI.SendMessage(this.Handle, ListViewAPI.LVM_SETTILEINFO, 0, ref apiTile);
            }

            //columns = null;
            Marshal.FreeHGlobal(lpcol);
        }
Beispiel #2
0
    public void ShowTiles(int[] columns)
    {
      ListViewAPI.LVTILEVIEWINFO apiTileView;
      ListViewAPI.LVTILEINFO apiTile;

      IntPtr lpcol = Marshal.AllocHGlobal(columns.Length * 4);
      Marshal.Copy(columns, 0, lpcol, columns.Length);

      int param = 0;
      _apiRetVal = ListViewAPI.SendMessage(this.Handle, ListViewAPI.LVM_SETVIEW, ListViewAPI.LV_VIEW_TILE, ref param);

      apiTileView = new ListViewAPI.LVTILEVIEWINFO();
      apiTileView.cbSize = Marshal.SizeOf(typeof (ListViewAPI.LVTILEVIEWINFO));
      apiTileView.dwMask = ListViewAPI.LVTVIM_COLUMNS | ListViewAPI.LVTVIM_TILESIZE;
      apiTileView.dwFlags = ListViewAPI.LVTVIF_AUTOSIZE;
      apiTileView.cLines = columns.Length;


      _apiRetVal = ListViewAPI.SendMessage(this.Handle, ListViewAPI.LVM_SETTILEVIEWINFO, 0, ref apiTileView);

      foreach (XPListViewItem itm in this.Items)
      {
        apiTile = new ListViewAPI.LVTILEINFO();
        apiTile.cbSize = Marshal.SizeOf(typeof (ListViewAPI.LVTILEINFO));
        apiTile.iItem = itm.Index;
        apiTile.cColumns = columns.Length;
        apiTile.puColumns = (int)lpcol;

        _apiRetVal = ListViewAPI.SendMessage(this.Handle, ListViewAPI.LVM_SETTILEINFO, 0, ref apiTile);
      }

      //columns = null;
      Marshal.FreeHGlobal(lpcol);
    }