Join 132,275 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,144 people online right now. Registration is fast and FREE... Join Now!
ok i have three list boxs 2 of which have information in them i want the user to choose one out of the first 2 list boxes and then display what they have chosen in the 3rd list box? thanks topher
This post has been edited by tophermackay: 23 Feb, 2008 - 09:45 PM
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
Post your code like this:
Thanks
ok well ill have to write some code, everything that i have read tells me to us a text box or a label not a list box.
This post has been edited by tophermackay: 23 Feb, 2008 - 09:41 PM
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
Post your code like this:
Thanks
ok well ill have to write some code, everything that i have read tells me to us a text box or a label not a list box.
ok so i thought this would work but it doesnt
CODE
Private Sub BtnAddWrkshp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAddWrkshp.Click
What exactly are you trying to do with that snippet of code?
i know their ia a way to allow a user to select an item out of 2 preloded listBoxs and then display what they selected in a 3rd list box so i can then write arguments for what is choosen? i thought this would work for lst1ws when selected with the mouse, and when the user clicks btnaddwrkshp it will show what user selected in lst1ws in lst2costs
What exactly are you trying to do with that snippet of code?
i know their ia a way to allow a user to select an item out of 2 preloded listBoxs and then display what they selected in a 3rd list box so i can then write arguments for what is choosen? i thought this would work for lst1ws when selected with the mouse, and when the user clicks btnaddwrkshp it will show what user selected in lst1ws in lst2costs
i can make it show in a messagebox but i cant make it show the selection in the 3rd list box
CODE
Private Sub BtnAddWrkshp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAddWrkshp.Click Dim count As Int16
That is because you need to Add it the the ListBox. And you should be using the SelectedItem property, not the SelectedIndex to get the text from the first ListBox.
ok i have been reading an and think that im on the right track but am still missing something this is what i have in the code i put notes for more help i am really new to vb everything that i know i have read so any help would be great thanks topher
CODE
Private Sub BtnAddWrkshp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAddWrkshp.Click Dim intnum As String If Lst1ws.SelectedIndex = -1 Then 'no Workshop is Selected MessageBox.Show(" Select a WorkShop ", "No WorkShop", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) ElseIf Lst2loc.SelectedIndex = -1 Then 'no Location is selected MessageBox.Show(" select a Location ", "No Location ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) Else 'get the selected workshop and location Lst3Costs = (Lst1ws.SelectedItem & " " & Lst2loc.SelectedItem) 'i thought that doing lst3costs = (Lst1ws.SelectedItem & " " & Lst2loc.SelectedItem) would put my information that was selected into the the lst3costs list box but it doesnt how else can i do that"