Hi Guys,
This is the first time I have wanted to use tabstrips and have a couple of questions .
I can build the tabstrip fine and name it - that part is from what I can see the easy bit.
What I want to do is select a tab then create a listbox on that tab, and then pupulate the list box with data.
For this test I am using the event viewer.
The system loades the logs into memory, and then creates however many system logs there are ie application, system security etc etc.
But how the hell do I select one of these tabs then draw a listbox and then address the list box - Ideally the list boxes etc will be created at the time of the tab ?
Here is my code for this (By the way its VB 2010)
Thanks for your help in advanceCode:Dim log As EventLog Dim lstname As String 'Gets logs on the local machine remoteEventLogs = EventLog.GetEventLogs(System.Environment.MachineName) 'Create the Tab's For Each log In remoteEventLogs TabControl1.Controls.Add(New TabPage(log.Log)) Dim tp As New TabPage tp.Text = log.Log Me.TabControl1.TabPages.Add(tp) Me.TabControl1.SelectedTab = tp Next log 'now select a tab and create a list box ?? Me.TabControl1.SelectTab(1) ' Selected tab 1 just as its the first ' Create an instance of the ListBox. Dim listBox1 As New ListBox() ' Set the size and location of the ListBox. listBox1.Size = New System.Drawing.Size(1055, 537) listBox1.Location = New System.Drawing.Point(106, 7) ' Add the ListBox to the form. selectedtab.Controls.Add(listBox1)
Jez




Reply With Quote