|
-
Dec 25th, 2006, 03:41 PM
#1
Thread Starter
Member
Listbox help
Ok so lets say a listbox has
Code:
________________________
|Hi |
|Bye |
| |
| |
| |
| |
----------------------------
How would I make it so that when my command button is clicked the textbox (text1) gets hi, and another command button is clicked, and another textbox(text2) gets bye, and so on?
-
Dec 25th, 2006, 03:53 PM
#2
Thread Starter
Member
-
Dec 25th, 2006, 03:59 PM
#3
Re: Listbox help
You could create an array of Command Buttons and an array of TextBoxes. And in the code, you could have something like:
VB Code:
Private Sub Command1_Click(Index As Integer)
text1(Index).Text = list1.List(Index)
End Sub
-
Dec 25th, 2006, 04:03 PM
#4
Thread Starter
Member
Re: Listbox help
There is a compile error saying procedure declaration does not match description of event or procedure having same name and highlights
Private Sub Command1_Click(Index As Integer)
-
Dec 25th, 2006, 04:20 PM
#5
Re: Listbox help
You need to make a control array of the Textboxes and the Command Buttons by setting their Index properties to "0".
Here's a quick example I made.
Last edited by DigiRev; Mar 26th, 2007 at 02:55 AM.
-
Dec 25th, 2006, 05:07 PM
#6
Thread Starter
Member
Re: Listbox help
How would I make this code, go through all of the lines of the list?
VB Code:
Private Sub Command2_Click(Index As Integer)
Dim stuff As String
Dim HTML As String
RW(0).SetProxy List1.List(0)
HTML = RW(0).Request("GET", "http://www.ipchicken.com/")
stuff = GetBetween(yourIP, "<b>", "<br>")
HTML = stuff
If stuff = yourIP Then
' yourIP is a textbox, with the real IP
List2.AddItem List1.List(0) & " doesn't work."
Else
List2.AddItem List1.List(0) & " works!"
End If
End Sub
Basically RW is a winsock wrapper. Now this is a proxy checker (this isn't whole code). So how would I make it so it goes through the whole list, checking all of the IPs?
-
Dec 25th, 2006, 05:51 PM
#7
Thread Starter
Member
Re: Listbox help
Also, how would you make a line on a listbox be copyable, but not editable?
-
Dec 25th, 2006, 06:01 PM
#8
Re: Listbox help
 Originally Posted by kennykilla
Also, how would you make a line on a listbox be copyable, but not editable?
That is the default behavior.
-
Dec 26th, 2006, 03:54 AM
#9
Re: Listbox help
so you mean to say, you have a listbox which contains IP address and you want to check all the IP address, if so, use a loop and scan thru the list like this...
VB Code:
Dim i As Integer
For i = 0 To List1.ListCount - 1
RW(0).SetProxy List1.List(i)
'....and so on
Next
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|