[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
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
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: [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.