473,405 Members | 2,300 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,405 software developers and data experts.

Id of a Dynamic Control

366 256MB
Hello Friends

I am developing a windows application where in Formload i am creating 4 buttons at runtime dynamically(mandatory ,please dont suggest to have buttons at design time ) ,upto this it is fine ,now i want to perform 4 different tasks for different buttons when clicked ,for that ineed the id of the button generated dynamically ,what will be the id of a dynamically generated control,isthere any way to find out or assign an id which creating itself

Please any idea ........

Thanks
Jun 18 '07 #1
3 1282
prabunewindia
199 100+
hi friend
u can set the id for each button while u create the button
ex:
Button btn=new Button();
btn.ID="btnID";
Prabu


Hello Friends

I am developing a windows application where in Formload i am creating 4 buttons at runtime dynamically(mandatory ,please dont suggest to have buttons at design time ) ,upto this it is fine ,now i want to perform 4 different tasks for different buttons when clicked ,for that ineed the id of the button generated dynamically ,what will be the id of a dynamically generated control,isthere any way to find out or assign an id which creating itself

Please any idea ........

Thanks
Jun 18 '07 #2
nmsreddi
366 256MB
Hello

Many thanks for your reply..

Actually my requirement is ,

i have childform with some controls placed on that ,and one MDI parent form .

at page load of the MDIParent i want to display 4 childs(actually one childform already with controls is displayed using for loop) at run time ,whose functionality will be different

how can the controls on the dynamically created forms can be accessed ,

Hope you got my problem ..

Regards
Jun 19 '07 #3
Plater
7,872 Expert 4TB
It still seems as though his suggestion is valid.

You have an MDIParent with a child window that will have dynamicly created buttons. Wherever those buttons are dynamically created you can add the .ID="whatever".

With that being said however, if you don't set the ID property, I *believe* they take on similar names as when you add them to a form. (i.e. "Button1", "Button2", "Button3", etc...)
You could always dynamically create a few test buttons and see what they get for their ID.
Jun 19 '07 #4

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

Similar topics

3
by: MikeY | last post by:
Hi Everyone, I am working in C#, windows forms.My question is this. All my button dynamic controls properties are present and accounted for except for the"FlatStyle" properties. I can't seem to...
3
by: Guy Harwood | last post by:
Hi, I have designed a textbox that inherits from the System.Windows.Forms.Textbox control. when the control is readonly the back color changes to a light blue to indicate that it is frozen. ...
6
by: MikeY | last post by:
Hi Everyone, Does anyone know where I can get my hands on a sample with source code of a simple dynamic button control in C# Windows form. I am looking for a sample that uses a class library...
2
by: Matt | last post by:
Hi, Can someone provide some information on how to create a control dynamically based on the contents of another dynamic control. In my experience, all dynamic controls must be created in the...
5
by: mytestemailaccount | last post by:
Hi, Hope you can help. I am relatively new to all this but would appreciate the groups help. The scenario: I am c# and asp.net to create a web application. The web page contains a user...
1
by: amirmira | last post by:
I have a multithreaded application is ASP.NET that checks the status of a process every 2 seconds. After the thread has completed, the values of dynamically added controls need to be changed...
2
by: dawg1998 | last post by:
I have a page that creates dynamic textboxes based on the number of fields a user chooses to fill out. This process worked great when the page was standalone. However, when I move to a...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
0
by: Eniac | last post by:
Hi, I've been working on a custom user control that needs to be modified and the validation is causing me headaches. The control used to generate a table of 4 rows x 7 columns to display all...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
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
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...

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.