[RESOLVED] SSTAB - Dynamic loading of controls onto tabs
I can't get the Rich Text Box to load on the second tab. It always loads on the first tab. How can I get dynamic created controls to load on the tabs other than the first one?
Code:
Dim RichTextBox1 As Object
Set RichTextBox1 = Me.Controls.Add("RichText.RichTextCtrl.1", "RichTextBox1")
SSTab.Tabs=2
SSTab1.Tab=1
Set RichTextBox1.Container = SSTab1
RichTextBox1.Visible = True
Re: SSTAB - Dynamic loading of controls onto tabs
i think you need to select the tab before loading the textbox:
Code:
Dim RichTextBox1 As Object
SSTab.Tabs=2
SSTab1.Tab=1
Set RichTextBox1 = Me.Controls.Add("RichText.RichTextCtrl.1", "RichTextBox1")
RichTextBox1.Visible = True
Re: SSTAB - Dynamic loading of controls onto tabs
id rather use tabstrip instead of sstab
Re: SSTAB - Dynamic loading of controls onto tabs
Randem, I see nothing wrong with the code you posted and it works fine for me. The problem is elsewhere.
Are you changing the Left property anywhere in your code? As with adding controls at runtime, the Tab with the control must be the current Tab when setting a control's Left property.
Re: SSTAB - Dynamic loading of controls onto tabs
mik706,
You didn't read the code... The tab is set.
brucevde,
How could it work? Do you see the RTF box on the second tab?
1 Attachment(s)
Re: SSTAB - Dynamic loading of controls onto tabs
Here is the code I have been playing with
Re: SSTAB - Dynamic loading of controls onto tabs
This is one of those quirky problems with the SSTab. Within Form_Load, you cannot add controls at runtime onto a Tab other than Tab 0.
Re: SSTAB - Dynamic loading of controls onto tabs
Thanks brucevde. That cleared up that mystery... It works when I move the routine out of the Form_Load Event. Strange....
Re: [RESOLVED] SSTAB - Dynamic loading of controls onto tabs
This really helped me you. I spent hours trying to figure out why my SSTab was not working properly (on startup.) My workaround was adding a timer that loaded the controls, then disabled itself.