473,786 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamic linklabel array

30 New Member
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:)

Expand|Select|Wrap|Line Numbers
  1. public class Form1 : Form
  2. {
  3. System.Windows.Forms.LinkLabel[] linklabel;
  4.  
  5.  
  6. this.linklabel = new LinkLabel[rowsize];
  7.  
  8. private void linklabelfunction_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  9.         {
  10.              MessageBox.Show("tetininafinsdfns");
  11.         }
  12.  
  13.  
  14. private void InitializeComponent()
  15.       {
  16. this.linklabel[12].LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linklabelfunction_LinkClicked);
  17. }
  18. }
  19.  
when i run the program it get me an error in the last line i upper.
also in my code is the loop that print on the form the labels.
i thing my error is in the lines that i write.could someone help me.
Feb 10 '08 #1
2 2139
kenobewan
4,871 Recognized Expert Specialist
What is the error? Try catch blocks help write errors.
Feb 10 '08 #2
prokopis
30 New Member
the problem is tha it compile me the program but when i run it it get my an error on the just by running the program to that line
i can't put try catch to that part on the program.this code is in the .Desingn.cs part of the program
Expand|Select|Wrap|Line Numbers
  1. this.linklabel[12].LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linklabelfunction_LinkClicked);
  2.  
it just give me an error nullreferenceEx ception unhandled
is this line correct?
Feb 10 '08 #3

Sign in to post your reply or Sign up for a free account.

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...
3
12030
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
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. ...
1
1256
by: halosonu | last post by:
hi this is srikanth i created one dynamic form in c#.net of windows application and also i put the some controlls on that upto now no problem but no one event fireing occurs for that what should i do the follwing line code was i written :: private void btnSignIn_Click(object sender, EventArgs e) { try { if (txtUserName.Text == "sri") {
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
8993
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.