Public Class Form1
Public i As Integer = 0
Dim i2 As Integer = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show()
Form2.BringToFront()
Form2.TopMost = True
Me.Enabled = False
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If ListBox5.SelectedIndex > -1 Then
ListBox1.SelectedIndex = ListBox5.SelectedIndex
ListBox2.SelectedIndex = ListBox5.SelectedIndex
ListBox3.SelectedIndex = ListBox5.SelectedIndex
ListBox4.SelectedIndex = ListBox5.SelectedIndex
End If
Do Until ListBox5.Items.Count = i And i2 = i
i2 = i2 + 1
ListBox5.Items.Add(i2)
Loop
End Sub
End Class
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form1.ListBox1.Items.Add(TextBox1.Text)
Form1.ListBox2.Items.Add(TextBox2.Text)
Form1.ListBox3.Items.Add(TextBox3.Text)
Form1.ListBox4.Items.Add(TextBox4.Text)
Form1.i = Form1.i + 1
End Sub
Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Form1.Enabled = True
Form1.BringToFront()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Re: Listbox HELP ?
Posted: Sun Jul 11, 2010 2:41 am
by Livengood
lesan101 wrote:
Scottie1972 wrote:forget the listbox...look into a ListView Control
i rather use listbox.
i can help you with this , i have a way to use listbox like that
Edit :
are you talking something like this?
Account Saver.zip
Re: Listbox HELP ?
Posted: Sun Jul 11, 2010 11:36 am
by mandai
If it has to be all in one listbox you can seperate the values with a tab character.
Dim index As Integer = ListBox1.Items.Add("value1" & vbTab & "value2" & vbTab & "value3")
Dim values As String() = ListBox1.Items(index).ToString().Split(vbTab)
MsgBox(values(0)) 'returns value1
Re: Listbox HELP ?
Posted: Sun Jul 11, 2010 10:46 pm
by lesan101
Okay i was able to get it..
now all i need is how to save it the listbox ?
the windows to add the info is form1
the lisbox window is form2
Re: Listbox HELP ?
Posted: Sun Jul 11, 2010 11:20 pm
by mandai
form2.ListBox1.Items.Add .. ?
Re: Listbox HELP ?
Posted: Sun Jul 11, 2010 11:35 pm
by lesan101
mandai wrote:form2.ListBox1.Items.Add .. ?
????
Re: Listbox HELP ?
Posted: Mon Jul 12, 2010 10:10 am
by mandai
What are you asking for exactly? Something to copy listbox items from one listbox to another?