Hi,
I assume you are using Xojo or REALBasic for you application?
Anyways, the connection options window is a regular window. If you're not sure how to add controls to a window, then I recommend completing the tutorial before continuing. Looking at some of the examples that come with Xojo is also helpful.
Ok, back the preferences window. The white box on the left is a ListBox. When you place the listbox, use the "InitialValue" property to enter the different items you want to show in the list. Add a Cancel and Ok button to the bottom right corner. Then you will need to add Canvases (all of them must be the same size) to the window, one for each list item. The first one needs to be placed on the window, to the right of the List Box and above the buttons. Place the other ones outside of the window. Make sure they are next to each other and do not overlap. Place all your controls to adjust your settings (textfields, labels, radio buttons, etc) onto the different canvases.
Add code to the "Open" event handler of your preferences to move all the canvases to the same location on the window, where you placed the first canvas. Use the "Top" and "Left" properties of Canvas to set the position of the canvases to the same coordinates. Set the "Visible" property of all the canvases, except for the first one, to "false". When the app runs and the preferences window opens, all the canvases will be in the same location, but only the first one will be visible.
Set the name of the Canvases to be the same and create a control array with the canvases so that you can access them using the index. E.g. name them "cvSettings" and set the index of the first canvas to 0, the second one to 1, etc. Then implement the "Change" event handler of the ListBox so that it makes the current canvas invisible and makes the Canvas that corresponds to the currently selected item in the list visible. I.e. your Change event handler will then look something like this:
Code: Select all
Sub Change()
dim i as integer = me.ListIndex
if not (cvSettings(i) is nil) then
cvSettings(CurrentCanvas).Visible = False
CurrentCanvas = i
cvSettings(CurrentCanvas).Visible = True
self.Refresh
end if
End Sub
In order for this to work you need to add a property "CurrentCanvas" to the window.