vincent15mark Posted September 12, 2010 Posted September 12, 2010 [ATTACH]5701._xfImport[/ATTACH] how can i count the number of item i have in my listbox and pass it to my txtTextListCount. here is my code for: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click myListbox.Items.Add(txtText.Text & "") End Sub Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load txtTextListCount.Text = myListbox.Items.Count End Sub Please help me.. Quote
Administrators PlausiblyDamp Posted September 13, 2010 Administrators Posted September 13, 2010 The code you have in the form_Load will work just fine, however it will only run when the form loads, if you want it to update every time you add something to the list you could just add that code to the end of Button1's Click event. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.