INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

soulpumpkin (Programmer) (OP)
22 Aug 05 8:28
Is this possible? I've tried using the following:

CODE

Dim link As New System.Web.UI.WebControls.HyperLink

        lstDuplicates.Columns.Add("Description", 250, HorizontalAlignment.Left)
        lstDuplicates.Columns.Add("Code - Worksheet Number", 250, HorizontalAlignment.Left)
        lstDuplicates.Columns.Add("File Name", 500, HorizontalAlignment.Left)

        'populate listview
        Do While x < (dataArray.Length - 1)
            If dataArray(x) = "" Then
            Else
                lvi = New ListViewItem
                lvi.Text = Trim(dataArray(x))
                lvi.SubItems.Add(Trim(dataArray(x + 3)))
                lvi.SubItems.Add(link(Trim(dataArray(x + 6))))
                lstDuplicates.Items.Add(lvi)
            End If
            x += 9
        Loop

This doesn't work, and tells me the result can't be indexed. I haven't worked with adding hyperlinks before to a listview. Any help would be welcomed.

Thanks,

Soul Pumpkin

ThatRickGuy (Programmer)
22 Aug 05 10:48
I was about to reply with a great answer. Then I realised you are in the wrong forum. Head over to the ASP.Net forum for the answer to all of your Web Form questions.

-Rick

VB.Net Forum forum796    forum855 ASP.NET Forum
    I believe in killer coding ninja monkeys.

soulpumpkin (Programmer) (OP)
22 Aug 05 12:03
I'm using VB, not ASP. I'm guessing from your response though, that I can't do this?

I'll look over there as well. Thanks.

Soul Pumpkin

ThatRickGuy (Programmer)
22 Aug 05 12:06
Oh, heh, mybust. I missread. Sorry, I'm just getting used to auto responding to ASP.Net questions ;)

I would create a datatable that contains the hyperlink text, and the actualy HREF. catch the onclick event of the list box, grab the record they clicked, and use system.diagnostics.process.start(HREF) to open the default browser to the link.

-Rick

VB.Net Forum forum796    forum855 ASP.NET Forum
    I believe in killer coding ninja monkeys.

soulpumpkin (Programmer) (OP)
22 Aug 05 12:09
That is awesome man. Thanks, I've been working on this thing for awhile now.

Thanks again,

Soul Pumpkin

lucyv (Programmer)
23 Aug 05 1:35
Rick

Is there a way you can underline the text in the listview so that you can give it the "look and feel" of a normal hyperlink?  I know you can change the color of the text as well as the mouse icon, but it would be really nice if the text could be underlined as well.

Thanks,

-lucyv
earthandfire (Programmer)
23 Aug 05 5:14
soulpumpkin and lucyv, you might want to have a look at the Glacial list view control - very powerful, flexible and easy to use and should easily do what both of you want.

The free version 1.3 is available from here:

http://www.codeproject.com/cs/miscctrl/aa_listview.asp

(ignore the c# code - just use the control) or you can buy the latest version from their website:

http://www.glacialcomponents.com/Default.aspx

The free version lets you specify the object type for a column, easy formatting of items and has an ItemClicked event, plus lots more.


Hope this helps.


soulpumpkin (Programmer) (OP)
23 Aug 05 7:32
Actually, the link I needed was to open a file local to disk. I didn't need to open browser or any, but I ended up using the system.diagnostics.process.start() and passing the full path of the file. Here is the code that is working now:

CODE

Private Sub lstDuplicates_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstDuplicates.SelectedIndexChanged
        System.Diagnostics.Process.Start(lstDuplicates.SelectedItems.Item(0).SubItems.Item(2).Text)
    End Sub

Thanks alot Rick. It was simple, and works great.

Soul Pumpkin

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close