Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create listview on specific page on tabcontrol 1

Status
Not open for further replies.

emmanuelbeaudet

Programmer
Apr 16, 2002
51
CA
Hi everybody,

I just want to add a listview that I had created on a specific page of the tabcontrol. If I just want to add it on the form I just have to put this code :

Me.Controls.Add(listview1)

but if I want to create it on the specific page of the tabcontrol ???

me.MyTabControl.MySpecificPage...???????

Thank you

emmanuel
 
Hi,

Each tabpage is a control in itself. Use the name of the tabpage:
------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyTabPage3 As New Windows.Forms.TabPage()
TabControl1.TabPages.Add(MyTabPage3)
Dim listview1 As New Windows.Forms.ListView()
MyTabPage3.Controls.Add(listview1)
End Sub
-------------------------------------------------------

Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Yes that works perfectly, but if I want to create it on a page that allready exist on not a new one ?

Thank you
 
As sunaj said just use
say u have tabpage1
Dim listview1 As New Windows.Forms.ListView()
tabpage1.Controls.Add(listview1)

Nouman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top