Listbox HELP ?
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
okay so im making a password saver program..
(because i dont want to continue using notepad to save my pass)
anyways im having an issue with the listbox.
i want everything to be organized...
example: everything spaced out equally, and lined up the same..
idk how to to that.. so this is what i get..
![Image]()
i want to turn it into this (all organized)
![Image]()
ANYONE..PLZ???
(because i dont want to continue using notepad to save my pass)
anyways im having an issue with the listbox.
i want everything to be organized...
example: everything spaced out equally, and lined up the same..
idk how to to that.. so this is what i get..

i want to turn it into this (all organized)

ANYONE..PLZ???
Scottie1972 wrote:forget the listbox...look into a ListView Controli rather use listbox.
Download
http://www.mediafire.com/file/r2kgomjmy1j/Mngr.zip
OR Define two integers, make sure they're Below PUBLIC CLASS FORM1!:
In this case form2 will be adding to it.
Use Five(5) different Listboxes, One(1) Timer, One(1) Button, Four(4) Labels(rename correctly from below)
![Image]()
Now add a new form. For begginners go to Project>Add Windows Form then press Ok.
![Image]()
Now Make your Form look like this and ofcourse the top textbox is #1, below is #2, #3, #4 in order
![Image]()
Time for the real coding:
Go back to form1 and double click or right click>ViewCode
Delete All Code and paste this:
http://www.mediafire.com/file/r2kgomjmy1j/Mngr.zip
OR Define two integers, make sure they're Below PUBLIC CLASS FORM1!:
Code: Select all
When you use 'Public' instead of 'Dim' the integer can be used with any form from this application.Public Class Form1
Public i As Integer = 0
Dim i2 As Integer = 0
In this case form2 will be adding to it.
Use Five(5) different Listboxes, One(1) Timer, One(1) Button, Four(4) Labels(rename correctly from below)

Now add a new form. For begginners go to Project>Add Windows Form then press Ok.

Now Make your Form look like this and ofcourse the top textbox is #1, below is #2, #3, #4 in order

Time for the real coding:
Go back to form1 and double click or right click>ViewCode
Delete All Code and paste this:
Code: Select all
Form2 Code: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
Code: Select all
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
You do not have the required permissions to view the files attached to this post.
lesan101 wrote:i can help you with thisScottie1972 wrote:forget the listbox...look into a ListView Controli rather use listbox.


Edit :
are you talking something like this?
You do not have the required permissions to view the files attached to this post.
If it has to be all in one listbox you can seperate the values with a tab character.
Example:
Example:
Code: Select all
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
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
now all i need is how to save it the listbox ?
the windows to add the info is form1
the lisbox window is form2
What are you asking for exactly? Something to copy listbox items from one listbox to another?
Copyright Information
Copyright © Codenstuff.com 2020 - 2023