Creating Runtime Controls in a TabControl

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to create some runtime controls in a TabControl

I've tried doing the following but no controls appear

txtBox = New TextBo
tabCtrl.TabPages.Item(2).Controls.Add(txtBox) ' 2 being the index of the page I want to add the contro
txtBox.Left = 10
txtBox.Right = 10
txtBox.Visible = Tru
txtBox.Enabled = Tru
txtBox.Show(

Can someone tell me where I'm going wrong

thanks in advanc

Dyla
 
Hi Dylan,

txtBox = New TextBox
TabPage2.Controls.Add(txtBox)
txtBox.Left = 100
txtBox.Right = 100
txtBox.Visible = True
txtBox.Enabled = True

Is more common code.

Cor
 
Dylan said:
I need to create some runtime controls in a TabControl.

I've tried doing the following but no controls appear:

txtBox = New TextBox
tabCtrl.TabPages.Item(2).Controls.Add(txtBox) ' 2 being the index of the page I want to add the control
txtBox.Left = 100
txtBox.Right = 100
txtBox.Visible = True
txtBox.Enabled = True
txtBox.Show()

Can someone tell me where I'm going wrong?

thanks in advance

Dylan
The Right property of textbox is read only. Without that, it works as
desired.

HTH,
APG
 
Back
Top