Results 1 to 7 of 7

Thread: adding links to a listbox [RESOLVED]

Hybrid View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2003
    Location
    Chicagoland
    Posts
    92

    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:
    1. For Each da As String In DArray
    2.     defLink.Text = da
    3.     defLink.NavigateUrl = "http://www.company.com/infolog.asp?info=" + da
    4.     ListBox1.Items.Add(defLink)
    5. 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:
    1. For Each da As String In DArray
    2.     ListBox1.Items.Add(da)
    3. Next
    This populates the listbox. Then I could get the selectedindexchanged event to trigger it like this:
    VB Code:
    1. Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
    2.     Process.Start("http://www.company.com/infolog.asp?info=" + sender.text)
    3. End Sub
    The problem is getting the text of the selected index. Any idea on how to do that?

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Nov 2003
    Location
    Chicagoland
    Posts
    92

    Re: adding links to a listbox

    Got it, "ListBox1.SelectedItem", Duh!

    VB Code:
    1. Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
    2.     Process.Start("http://www.company.com/infolog.asp?info=" + ListBox1.SelectedItem)
    3. End Sub

    Thanks guys.

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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

  4. #4
    Member
    Join Date
    Jan 2005
    Location
    in the nederlands
    Posts
    37

    Talking Re: adding links to a listbox [RESOLVED]

    what is asp.NET ???
    what is xml ???

    help my please on this link for xml
    http://www.vbforums.com/showthread.php?t=322815



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width