Forum Post: RE: Add variable to checkedlistbox

Status
Not open for further replies.
R

Rob Debbage

Guest
Hello, There are probably many ways to do this. Here are a couple of suggestions. Option#1 - use the AddRange method on the Items collection to add a pre-filled array: DEFINE VARIABLE arrayvar0 AS System.Object EXTENT 5 NO-UNDO. ASSIGN arrayvar0[1] = "test1" arrayvar0[2] = "test2" arrayvar0[3] = "test3" arrayvar0[4] = "test4" arrayvar0[5] = "test5" . checkedListBox1:Items:AddRange(arrayvar0). Option #2 - populate checkedListBox via a method called in the constructor after other controls are initialized. Create a new method that populates the checkedListBox using the Add() method. Call this method in your form's Constructor after InitializeComponent() is called, e.g. CONSTRUCTOR PUBLIC ChecklistBox ( ): SUPER(). InitializeComponent(). THIS-OBJECT:ComponentsCollection:ADD(THIS-OBJECT:components). populateCheckedListBox(). ...

Continue reading...
 
Status
Not open for further replies.
Top