Announcement

Collapse
No announcement yet.

Listbox / Listview - trying to make them behave a certain way.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Listbox / Listview - trying to make them behave a certain way.

    In my normal OCD view of windows controls - I am trying to either improve on the columns in Listbox OR stop Listview from allowing re-sizing of columns.

    I was thinking I could roll my own listbox columns by getting the width of the "data" between the tabs. Is GetTextExtentPoint32 the best way to calculate the text width?

    So if the string was "dog $tab cat $tab fish" I could parse that into 3 fields and force field 1 to position 0 then move to 250 for cat etc...??


  • #2
    Check out LVCFMT_FIXED_WIDTH or HDF_FIXEDWIDTH styles

    Comment


    • #3
      Discussed previously https://forum.powerbasic.com/forum/u...zing#post54528

      Comment


      • #4
        I find the default resizeable colums the easiest to work with. I absolutely hate fixed sized columns.
        (I want to determine that myself as user, not being forced to a certain layout ...)
        Regards,
        Peter

        Comment


        • #5
          So if the string was "dog $tab cat $tab fish" I could parse that into 3 fields and force field 1 to position 0 then move to 250 for cat etc...??
          As Stuart implied, it might be better to use the multi-column control (report style listview) instead of the single column listbox control when your data are in fact columnar.

          The reason you see listboxes used this way is the listVIEW was not available until the MS Common Controls became available in Win/95... those of us who programmed in Win/16 ( Win 3 and 3.11 WFWG) had no intrinsic multi-column control to use.

          Just a caution about always when converting an older program or code snippet, ask yourself, "Is there an better way TODAY?"

          ADDED:
          Oh, the other part is, "Always know what tools are in your toolbox."
          Last edited by Michael Mattias; 29 Jun 2020, 11:38 AM. Reason: Add tools/toolbox comment
          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment

          Working...
          X