Using sub-stings in non report view

I wanted a CListCtrl in icon view mode only (no switch to other view modes), but tried to "store" additional string information in subitems.

So I've useed used ...

        SetItemText (nIndex, 1, strMoreInfo)
and according to the help it returned Nonzero for "successful". but then later on when I tried to use that string with
        GetItemText (iItem, 1);
it return sucessful with nothing. :( The string was gone.

To make a long story short, one can't store subitems without a header. So an easy solution is to define two "blind" headers like ...

        for(int iHeader=0; iHeader < 2; iHeader++)
        {
                InsertColumn (iHeader, "header", LVCFMT_LEFT, -1, iHeader);
        }
and you can store whatever string you want in subitem.



Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Speed. Agility. Flexibility. There are the big drivers behind most organizations' move to the cloud for their test/dev environments. Freed from the shackles of physical, on-premises infrastructures means test/dev teams can be incredibly fast, both in standing up and tearing down test beds. They can manage version control and they can share work between teams faster ever than below. Read this white paper to learn how your business can respond faster to the rapidly changing needs of customers with a cloud-based …

  • Gaining a competitive advantage in the modern marketplace requires an infrastructure that allows for the secure execution of data and analytics, cloud, social, and mobile technologies. Perhaps one of the most significant trends among technologically visionary companies is the drive to unite infrastructure and security teams. With functional alignment across these teams, organizations unlock performance and reliability through a proactive threat detection and mitigation approach. With this alignment in mind, …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date