05-09-2025, 03:08 AM
(05-08-2025, 10:59 PM)a740g Wrote:(05-08-2025, 10:11 PM)bobalooie Wrote: I see from the Wiki that, for list boxes, only reading the selection value is available at runtime. Is there a workaround to fudge the ability to set the value at runtime?
TIA
You can use following to modify the list at runtime.
- AddItem
- RemoveItem
- ResetList
- ReplaceItem
- GetItem
See here: https://github.com/a740g/InForm-PE/wiki/List
Also see mpgcan's InForm-PE tutorial that covers almost every part of InForm - https://qb64phoenix.com/forum/showthread.php?tid=2600
I've studied these methods, but none of them do what I need. I am working on an analysis program for which a couple of data point are a choice from a preset list of valid choices. I am using list boxes so that I can restrict the user's choice to one of the valid choices without having to bother with validation. The issue comes up when I am loading a saved analysis file to populate the analysis dialog. In VB or Lazarus, I could simply set the ItemIndex property of the list box to select the value that was selected before. I'd like to do that with InForm, but I can't find a method to do that. I tried Control(handle).Value = xx just for funsies, but the IDE throws an error.
It's not the having, it's the doing.