|
-
Feb 1st, 2005, 03:18 PM
#1
Thread Starter
Lively Member
Re: adding links to a listbox
vbdotnetboy, as per usual, that thought hit me 3 minutes after I hit the post button.
So now I have:
VB Code:
For Each da As String In DArray
defLink.Text = da
defLink.NavigateUrl = "http://www.company.com/infolog.asp?info=" + da
ListBox1.Items.Add(defLink)
Next
Stepping through the code, the attributes get populated correctly, but the listbox displays "System.Web.UI.MobileControls.Link".
Hmmm... VBnetFan at first I didn't think your idea applied, but now I have an idea. Say that DArray is already sorted and I do:
VB Code:
For Each da As String In DArray
ListBox1.Items.Add(da)
Next
This populates the listbox. Then I could get the selectedindexchanged event to trigger it like this:
VB Code:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Process.Start("http://www.company.com/infolog.asp?info=" + sender.text)
End Sub
The problem is getting the text of the selected index. Any idea on how to do that?
-
Feb 1st, 2005, 03:46 PM
#2
Thread Starter
Lively Member
Re: adding links to a listbox
Got it, "ListBox1.SelectedItem", Duh!
VB Code:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Process.Start("http://www.company.com/infolog.asp?info=" + ListBox1.SelectedItem)
End Sub
Thanks guys.
-
Feb 1st, 2005, 04:05 PM
#3
Re: adding links to a listbox [RESOLVED]
just for the record... this is a windows app right??? I think everyone who posted thinks its an ASP.NET app
-
Feb 2nd, 2005, 03:47 AM
#4
Member
Re: adding links to a listbox [RESOLVED]
what is asp.NET ???
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
|