You need to use a control set of checkboxes on your window. Drag a checkbox on your window, name it FileCheckBox, in the inspector select the gear icon and change the Member of to New control Set. Then you can either duplicate the control on the window or create instances in code.
[quote=209293:@Meade Lewis]I am working on a desktop project where I would like to create a CheckBox using code when a file is opened. What I have so far is the following:
dim FileCheckBox(10) as CheckBox
FileCheckBox(FileCount) = New CheckBox
FileCheckBox(FileCount).Caption = OpenFile.name //OpenFile is a folder item
FileCheckBox(FileCount).left = 380
if FileCount = 0 then
FileCheckBox(FileCount).Top = 40
else
FileCheckBox(FileCount).Top = (20*filecount)+40
end
FileCheckBox(FileCount).enabled = true
FileCheckBox(FileCount).Visible = true
FileCheckBox(FileCount).value = true
FileCount = FileCount +1[/code]
Nothing appears when I run the program yet, from debugging, I can tell that the folder item is coming in correctly. What am I doing wrong?
As always, a thousand thank yous![/quote]
To create checkboxes dynamically, make one a Control Set (in the gear part of the Inspector), then you will be able to create new members at will.
[code] dim c as new CheckBox1
Yeah, dynamically creating the UI for this project seems like an inevitable requirement. Thank you so much Norman! I always appreciate your input and wizardry!