473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problems Dynamically creating a LinkLabel

Hi There,

I'm trying to create a link label dynmically. The problems I'm having is
the following:
1. The LinkLabel is created without the underline
2. The click event is not being raised...

Here's my code:

Dim newLink As New LinkLabel()
With newLink
pnlTitle.Controls.AddRange(New System.Windows.Forms.Control() {newLink})
..Left = 100
..Top = 100
..AutoSize = True
..LinkBehavior = LinkBehavior.AlwaysUnderline
..ActiveLinkColor = System.Drawing.Color.Red
..Font = FontConv.ConvertFromString("Verdana, 14.25pt")
..Text = Desc
AddHandler .Click, AddressOf Me.Links_LinkClicked
AddHandler .MouseMove, AddressOf Me.Links_MM
End With

and the subs:
Private Sub Links_LinkClicked(ByVal sender As Object, ByVal e As
System.EventArgs)
MessageBox.Show("Link Clicked")
End Sub

Any Ideas?

Josh
Nov 20 '05 #1
1 3722
* "Joshua Ellul" <je****@onvol.net> scripsit:
I'm trying to create a link label dynmically. The problems I'm having is
the following:
1. The LinkLabel is created without the underline
2. The click event is not being raised...

Here's my code:

Dim newLink As New LinkLabel()
With newLink
pnlTitle.Controls.AddRange(New System.Windows.Forms.Control() {newLink})
.Left = 100
.Top = 100
.AutoSize = True
.LinkBehavior = LinkBehavior.AlwaysUnderline
.ActiveLinkColor = System.Drawing.Color.Red
.Font = FontConv.ConvertFromString("Verdana, 14.25pt")
.Text = Desc
AddHandler .Click, AddressOf Me.Links_LinkClicked
AddHandler .MouseMove, AddressOf Me.Links_MM
End With

and the subs:
Private Sub Links_LinkClicked(ByVal sender As Object, ByVal e As
System.EventArgs)
MessageBox.Show("Link Clicked")
End Sub

Any Ideas?


I am not able to repro problem 2 with the code listed above. I use .NET 1.0,
Windows XP Professional.

For your 1st gestion:

\\\
..Font = New Font(Me.Font, FontStyle.Underline)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

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

Similar topics

0
by: Max | last post by:
Suppose we have an object hierarchy in XSD. For example, let us take Control, Label, TextBox and LinkLabel windows controls. Each control has some properties which are represented as elements....
0
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...
0
by: Frnak McKenney | last post by:
One of the reasons given for the Allied victory in WWI is that the Nazi armament industry invested so much effort in creating new weapons (e.g. the jet plane) it wasn't able to develop any of them...
1
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...
3
by: vince | last post by:
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
2
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...
3
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...
2
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...
0
by: georgevarghese3 | last post by:
i was able to add linklabel dynamically to split continer and if the text of the link label is bigger than the pannel in the contianer then i use scroll but after that when again adding the control...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.