Results 1 to 6 of 6

Thread: [2.0] Hyperlinks

  1. #1

    Thread Starter
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    [2.0] Hyperlinks

    How would i go about adding a link to a textbox, but the catch is it needs to display specified text but when clicked go to the web site.

    So what i have is a listbox where when i go to add something i have to give the program the URL and Text. I am a little concerned how to go about this

    Any ideas?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Hyperlinks

    I'm a little confused by your explanation. Can you give a clear, step-by-step explanation of how you see it working?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: [2.0] Hyperlinks

    I will click a button and it will make a form appear asking me to enter the text to be added to the listbox and the url.

    Once i enter everything and click "Ok", I need to add the text to the listbox but somehow store the url together with the text. Because when it is clicked in the listbox it needs to execute the site in a new browser window.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Hyperlinks

    So define your own class or, more likely, structure with a property for the friendly name and a property for the address. Create a collection of these objects and bind it to ListBox, setting the DisplayMember to display the friendly name and the ValueMember to get the URL via the SelectedValue.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: [2.0] Hyperlinks

    Kk thanks, ill have a try and see if it works.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Hyperlinks

    I would suggest making your collection a BindingList. That way you can add and remove items from the list and the bound control will update automatically. Otherwise you'd have to refresh the control manually each time.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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