473,799 Members | 3,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic Controlls in C#.NET

1 New Member
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.Te xt == "sri")
{
if (txtPassword.Te xt == "sri")
{
Form frm = new Form();
MessageBox.Show ("hello " + txtUserName.Tex t.ToString());
frm.Show();
TextBox t = new TextBox();
t.Location = new Point(100, 20);
frm.Width = 778; frm.Height = 446;
LinkLabel lnknext = new LinkLabel();
LinkLabel lnkclose = new LinkLabel();
lnkclose.Text = "close";
lnknext.Text = "next";
lnknext.Font = new Font("italic", 12);
lnkclose.Font = new Font("italic", 12);
lnknext.Locatio n = new Point(80, 60);
lnkclose.Locati on = new Point(200, 60);
frm.Controls.Ad d(t);
frm.Controls.Ad d(lnknext);
frm.Controls.Ad d(lnkclose);
MessageBox.Show (t.Text.ToStrin g());
}
else
MessageBox.Show ("invailed..... ..");
}
else
MessageBox.Show ("invailed..... ..");
}

catch (Exception ex)
{
throw ex;
}
}

private void btnCancel_Click (object sender, EventArgs e)
{
Close();

}
private void lnkclose_Click( object sender, EventArgs e)
{
MessageBox.Show ("****from child form.........." );
Close();
}
Aug 29 '07 #1
1 1256
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
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.Te xt == "sri")
{
if (txtPassword.Te xt == "sri")
{
Form frm = new Form();
MessageBox.Show ("hello " + txtUserName.Tex t.ToString());
frm.Show();
TextBox t = new TextBox();
t.Location = new Point(100, 20);
frm.Width = 778; frm.Height = 446;
LinkLabel lnknext = new LinkLabel();
LinkLabel lnkclose = new LinkLabel();
lnkclose.Text = "close";
lnknext.Text = "next";
lnknext.Font = new Font("italic", 12);
lnkclose.Font = new Font("italic", 12);
lnknext.Locatio n = new Point(80, 60);
lnkclose.Locati on = new Point(200, 60);
frm.Controls.Ad d(t);
frm.Controls.Ad d(lnknext);
frm.Controls.Ad d(lnkclose);
MessageBox.Show (t.Text.ToStrin g());
}
else
MessageBox.Show ("invailed..... ..");
}
else
MessageBox.Show ("invailed..... ..");
}

catch (Exception ex)
{
throw ex;
}
}

private void btnCancel_Click (object sender, EventArgs e)
{
Close();

}
private void lnkclose_Click( object sender, EventArgs e)
{
MessageBox.Show ("****from child form.........." );
Close();
}
Do you know which of the events are not being fired? and the names of the respective controls!
You most probably need to register the event handlers. Let me know if you arent able to do it. And post the dynamic variables and their associated events which have to be fired.

Cheers
Aug 29 '07 #2

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

Similar topics

0
1891
by: Roel Wuyts | last post by:
CALL FOR CONTRIBUTIONS International Workshop on Revival of Dynamic Languages http://pico.vub.ac.be/~wdmeuter/RDL04/index.html (at OOPSLA2004, Vancouver, British Columbia, Canada, October 24-28, 200) Organization committee: Roel Wuyts (primary contact - roel.wuyts@ulb.ac.be), Gilad Bracha, Wolfgang De Meuter, Stéphane Ducasse and Oscar Nierstrasz.
8
7934
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the header of the datagrid in the "ItemDataBound" method of the grid. However, once, they are added in the grid, i seem to lose the event handler for the same control. Is there anyone who has tried this before and knows why this is hapenning ??
2
281
by: paja | last post by:
Hi I need to use the "Slider" control. When I drag and drop this contol I get a message that the ActiveX is not licensed and cannot be used In older version where this Slider was used successfully, when I open the form all controlls are invisible although all code is there Any suggestion are welcome Cheers
1
1503
by: paja | last post by:
Hello All I have been trying looking for Slider control required for one of the application. I have looked in default Form controls, then tried to add controls from COM components, but could not find one Can anybody please tell me where can I find such control or is there any external place/site where I can get such cotrolls. I have noticed that when adding any extra controlls it does have a file Browse option which indicates that...
6
2986
by: Materialised | last post by:
Hi Everyone, I apologise if this is covered in the FAQ, I did look, but nothing actually stood out to me as being relative to my subject. I want to create a 2 dimensional array, a 'array of strings'. I already know that no individual string will be longer than 50 characters. I just don't know before run time how many elements of the array will be needed. I have heard it is possible to dynamically allocate memory for a 2
1
2209
by: Jakob Nielsen | last post by:
I have implemented a container class with IList and bound it to a listbox. Works just fine, but if i then add a new item to my list, the listbox is not updated. Looking at the definition for IList it is clear that it does not have any events to tell the bound controlls about changes, but can it really be that after adding to the list I allways have to call an update method for the listbox? I would rather have designed the interface to...
0
2074
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab, System and Software Engineering Lab), ULB (deComp) and the Belgian Association for Dynamic Languages (BADL) are very pleased to invite you to a whole day of presentations about the programming languages Self, Smalltalk and Common Lisp by experts in...
5
2588
by: bearophileHUGS | last post by:
I often use Python to write small programs, in the range of 50-500 lines of code. For example to process some bioinformatics data, perform some data munging, to apply a randomized optimization algorithm to solve a certain messy problem, and many different things. For that I often use several general modules that I have written, like implementation of certain data structures, and small general "utility" functions/classes, plus of course...
0
10488
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
10257
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...
0
10029
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...
0
9077
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...
0
6808
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
5467
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...
1
4144
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
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.