You cannot create a radio button on screen if one does not exist already.
Some people create a window with the maxmimum number of radio buttons they would ever need, and make most of them visible = false at first.
Then make as many as they need visible afterwards
The other way to to do it is to add one radio button in the IDE,
Then go to the inspector, and set ‘member of’ to say ‘new control set’
Now, the control has an index number.
Say it is called MyRadio
And at run time you need another 3 of them
You do it in code something like this
dim r as MyRadio
dim t as integer = MyRadio.top //may need to be MyRadio(0) .. this is untested code
for x as integer = 0 to 2
r = new MyRadio
r.top = t + MyRadio(0).height + 30 //set the top position relative to the last one
r.left = MyRadio(0).left //set the left position relative to the last one
r.caption = "Clone " + x.totext // or format(x,"0") in api 1
t = r.top //update our vertical position monitor
next
If there is a possibility that the list would be too big for the screen, you may prefer to use a listbox with single row selection.
Hi Jeff,
This work perfect, So like you say, I have more than three item, so that my layout was break out side.
However in my case, I can’t use Listbox, because can use listbox everything was easy.
Can we use something may make scrollable, or same?
There is little difference between a listbox where one row can be selected, and a list of scrolling radio buttons.
But the user will be more familiar with a listbox.