I am new to progress.net so i've got a question to u guys. How can I add a variable to a checkedlistbox? I thought like this? But I get an error. arrayvar0 = "Add-MailboxPermission " + STRING(THIS-OBJECT:IDENTITY:TEXT) + " -User user -AccessRights FullAccess -InheritanceType all". Can anyone help me? greetz Rick
I'm assuming that when you say "add a variable", you meant that you want to add an item to the CheckedListBox. If so, you should be able to use the Add() method on the CheckedListBox's Item collection to do this. For example,
"test1" will appear in the CheckedListBox.
Thanks for your reply, but I want to know if it is possible to use something like this? i've got something like 20 items in my checkedlistbox. If im using ADD I have to fill it after my fillinboxes.
arrayvar0 = "Add-MailboxPermission " + STRING(THIS-OBJECT:IDENTITY:TEXT) + " -User user -AccessRights FullAccess -InheritanceType all".
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.
arrayvar0 = "test1"
arrayvar0 = "test2"
arrayvar0 = "test3"
arrayvar0 = "test4"
arrayvar0 = "test5"
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 ( ):