|
-
Jan 30th, 2008, 05:30 PM
#1
Thread Starter
Interweb adm/o/distrator
[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?
-
Jan 30th, 2008, 05:39 PM
#2
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?
-
Jan 30th, 2008, 05:50 PM
#3
Thread Starter
Interweb adm/o/distrator
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.
-
Jan 30th, 2008, 06:13 PM
#4
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.
-
Jan 30th, 2008, 06:23 PM
#5
Thread Starter
Interweb adm/o/distrator
Re: [2.0] Hyperlinks
Kk thanks, ill have a try and see if it works.
-
Jan 30th, 2008, 06:30 PM
#6
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.
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
|