473,787 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add LinkLabel in a ListBox

Hello,

I have a ListBox filled with many lines of simply text
I want to make few lines be a LinkLabel

How can I do this

Thanks
Nov 21 '05 #1
3 12030
Add a linklabel control to the controls collection of the listbox:

Dim olink As New LinkLabel
olink.Text = "Google"
olink.Links.Add (0, Len(olink.Text) , "www.google.com ")
ListBox1.Contro ls.Add(olink)

Add a handler for the LinkClicked event of the LinkLabel and add code to
navigate to the URL that's specified by the LinkLabel:

AddHandler olink.LinkClick ed, AddressOf LinkClicked

Private Sub LinkClicked(ByV al sender As Object, _
ByVal e As System.Windows. Forms.LinkLabel LinkClickedEven tArgs)
System.Diagnost ics.Process.Sta rt(CStr(e.Link. LinkData))
End Sub

hope that helps..
Imran.
Hello,

I have a ListBox filled with many lines of simply text I want to make
few lines be a LinkLabel

How can I do this

Thanks


Nov 21 '05 #2
"vince" <vi***@discussi ons.microsoft.c om> schrieb:
I have a ListBox filled with many lines of simply text
I want to make few lines be a LinkLabel


You can set the listbox' 'DrawMode' to 'OwnerDraw*' and then draw the items
accordingly in the 'DrawItem' event.0

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
Thanks Imran
You have resolve my problem

Vince

"Imran Koradia" wrote:
Add a linklabel control to the controls collection of the listbox:

Dim olink As New LinkLabel
olink.Text = "Google"
olink.Links.Add (0, Len(olink.Text) , "www.google.com ")
ListBox1.Contro ls.Add(olink)

Add a handler for the LinkClicked event of the LinkLabel and add code to
navigate to the URL that's specified by the LinkLabel:

AddHandler olink.LinkClick ed, AddressOf LinkClicked

Private Sub LinkClicked(ByV al sender As Object, _
ByVal e As System.Windows. Forms.LinkLabel LinkClickedEven tArgs)
System.Diagnost ics.Process.Sta rt(CStr(e.Link. LinkData))
End Sub

hope that helps..
Imran.
Hello,

I have a ListBox filled with many lines of simply text I want to make
few lines be a LinkLabel

How can I do this

Thanks


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1894
by: tota | last post by:
i'm using windowsApplication to connect to DB made by SQL i need to Display the Data of the first table in the DB as links when click it it openes a table and i navigte between them using buttons my problem is that i need to make the retrieved data as links (similar to objectList in Mobile application) i used LinkLabel to make an array of LinkLabels for (int n=0 ; i<j ; i++) {
1
5328
by: gabe | last post by:
I am looking for a way to mimic some of the functionality of a web page without writing html (or I am looking to someone to point out something really obvious that I am over looking) Currently I read out some data into a dataset then appending it to a richtextbox. So far so good. Some of the fields that I append are paths to documents. I would like to be able to click on the paths (like a hyperlink) I am able to create a linklabel at...
0
1268
by: Suz | last post by:
I am stumped! I can't seem to figure out how to put a linklabel in a datagrid on a windows form. I have working code that displays a linklabel in edit mode but need the linklabel to display during the initial datagrid load. I am working with datagridcolumnstyles. I have looked at combobox examples, etc but can't seem to extrapolate. Any help appreciated! Thanks!
1
1745
by: Marcus Kwok | last post by:
I am having problems getting my LinkLabel hyperlink to work properly. Every time I click on it, I get the following exception: System.ComponentModel.Win32Exception: The requested lookup key was not found in any active activation context at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at...
2
3057
by: Terrance | last post by:
Can someone please help with a problem that I'm having? I'm trying to create a linklabel in VB.NET 2003 at runtime when a user clicks a button. The app looks in a path for .doc and .pdf files and creates a linklabel for each file name. When running the app the first name is being created but only portions of the string is showing; and also it looks like the remaining is being created but I can't see them it's like their cut off. Here is the...
4
6583
by: David Veeneman | last post by:
I'm creating a UserControl that uses a LinkLabel. For reasons that I won't bore everyone with, I don't want the LinkLable to show the default hand cursor when the mouse enters the control. Should be a simple setting on the LinkLabel.Cursor property, right? Not so simple. I set the property, but still got the default 'hand' cursor. To debug, I added the following event handler to my LinkLabel control: private void...
3
4695
by: bsturg21 | last post by:
Hello, I have a windows form that has a series of linklabels on it, and I need to have each linklabel, when clicked, open a separate windows form that has a single paramter passed into it. The form that has the System.Windows.Forms.LinkLabel controls on it is in a different project and under a different namespace from the file where the LinkLabel_LinkClicked events are, so I can't just do frm.ShowDialog under the LinkClicked method. ...
0
2365
by: kirk | last post by:
I started with a System.Windows.Forms.Form and subscribed to its LostFocus event. The event fires perfect. I added a System.Windows.Forms.LinkLabel to the aforementioned Form and tested the same LostFocus event again. It does not fire any longer. If I remove the LinkLabel, LostFocus fires again. Why does this fail and how can I get LostFocus to fire for the container Form with a LinkLabel present?
2
2139
by: prokopis | last post by:
am using c# for windows applications. am using dynamic linklayer array to print some labels in the form.i get some data from the database i add them in the linklabel array and i print it on the screen. my problem is how to make that linklabel to work when i select the label.am using the code below but is not working:) public class Form1 : Form { System.Windows.Forms.LinkLabel linklabel;
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.