Re: tabcontrol problem!!!
You'll want to store all the information for all the tabs somehow. This could be in a list of the set of data you need stored (that set could be anything depending on what you're using it for... eg a list of where the controls on that tab are located, text from in a textbox, a listbox's list of items...).
When the user clicks a tab, you load the data for the appropiate tab.
Hope that helps
Re: tabcontrol problem!!!
can u show me the examples of the codes?
Re: tabcontrol problem!!!
Only if you write it for me...
... alright... fine... start here or here... check google for more.
Re: tabcontrol problem!!!
Private Sub TabPage1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Click
Dim strcon As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source =C:\temp\db1.mdb"
Dim con As OleDb.OleDbConnection
Dim dr As OleDb.OleDbDataReader
Dim cmd As New OleDb.OleDbCommand
Try
Dim strselect As String = "Select * from fine where fineType = '" & cbxtype.Text & "' And BorrowerId = '" & Form1.tbxID.Text & "'"
con = New OleDb.OleDbConnection(strcon)
'create a new connection
con = New OleDb.OleDbConnection(strcon)
con.Open()
cmd.Connection = con
cmd.CommandText = strselect
dr = cmd.ExecuteReader
If TabPage1.Text = "Lost" Then
lost.ShowDialog()
End If
While dr.Read()
Dim Item As New ListViewItem
Item.Text = (dr("fineId"))
Item.SubItems.Add(dr("itemId"))
Item.SubItems.Add(dr("itemTitle"))
Item.SubItems.Add(dr("dueDate"))
Item.SubItems.Add(dr("dateReturn"))
Item.SubItems.Add(dr("daysOverdue"))
TabControl1.Item.Add(Item)
End While
dr.Close()
Catch eException As Exception
MessageBox.Show(eException.Message)
End Try
End Sub
this is the codes. can u like help me to solve the codes??
Re: tabcontrol problem!!!
Quote:
Originally Posted by twinkie
this is the codes. can u like help me to solve the codes??
This isn't the best way to ask that question. You need to specify what your problem is. Do you not understand the code? Is it not compiling? Is it not doing what you expect? If so, what is the problem? Is it giving an error? If so what is the error? ... The list goes on. I could be here a week guessing what you want, so please specify in more detail your question and I'll try if I can.
Also, please include what version of VB you are using in the title of the thread in future, because that makes a difference as well. What version are you using?
From the looks of it the code is accessing a database of some sort. If this is the case, I might not be the best person to help, but I can try anyway. Post back with a more specific question and we can try again :)