Can tabs be created dynamically on a destop form? Or more specifically can the code of Learning XDialog Chapter 8 on creating tabs be used with a desktop form using XBasic?
I would like to add tabs dynamically to a form.
Here's an example:
Person A has Addresses, Books and CDs
Person B has Addresses, DVDs, and VCR tapes
When I open the person form, I would like to display tabs for each of the above categories. In my example above, Person A and B would each have three tabs by the title of the tabs would be different.
What I do NOT want to do is create tabs as follows for all persons:
Addresses, Books, CDs, DVDs, VCR tapes
In the past, I did something like this fairly easily using a Microsoft Access Tab Strip control.
Here is some sample code on how to do this using Microsoft Access.
In this example, the tab control is placed on the form, and then the properties of the tabs including text and perhaps subform can be specified with Visual Basic code.
I am not interested in using XDialog to create a complete form, but wonder if the code in the XDialog examples can somehow be applied to Alpha's Tab control in the form's toolboxes?
Or to accomplish this do you have to abandon Alpha's tab control altogether?
Bob McGaffic
Pittsburgh, PA
I would like to add tabs dynamically to a form.
Here's an example:
Person A has Addresses, Books and CDs
Person B has Addresses, DVDs, and VCR tapes
When I open the person form, I would like to display tabs for each of the above categories. In my example above, Person A and B would each have three tabs by the title of the tabs would be different.
What I do NOT want to do is create tabs as follows for all persons:
Addresses, Books, CDs, DVDs, VCR tapes
In the past, I did something like this fairly easily using a Microsoft Access Tab Strip control.
Here is some sample code on how to do this using Microsoft Access.
Code:
Dim txt1 As New System.Windows.Forms.TextBox Dim lbl1 As New System.Windows.Forms.Label lbl1.Text = "abc" Dim cbo1 As New System.Windows.Forms.ComboBox With cbo1 cbo1.Items.Add("1") cbo1.Items.Add("2") cbo1.Items.Add("3") cbo1.SelectedIndex = 0 End With With TabControl1 .TabPages.Item(0).Text = "General Info" .TabPages.Item(0).Name = .TabPages.Item(0).Text .TabPages.Item(1).Text = "Details" .TabPages.Item(1).Name = .TabPages.Item(1).Text .TabPages.Add("Implementation") .TabPages.Item(2).Name = .TabPages.Item(2).Text .TabPages.Item(0).Controls.Add(txt1) .TabPages.Item("Details").Controls.Add(lbl1) .TabPages.Item(2).Controls.Add(cbo1) End With
I am not interested in using XDialog to create a complete form, but wonder if the code in the XDialog examples can somehow be applied to Alpha's Tab control in the form's toolboxes?
Or to accomplish this do you have to abandon Alpha's tab control altogether?
Bob McGaffic
Pittsburgh, PA
Comment