473,626 Members | 3,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting the checked status of dynamically created check boxes

9 New Member
I have created some check boxes dynamically but i cant get the checked status of those checkboxes in another event, how can i get it ?
Mar 15 '07 #1
4 1612
kenobewan
4,871 Recognized Expert Specialist
Please provide more information and platform that you are running. Thanks.
Mar 15 '07 #2
shweta123
692 Recognized Expert Contributor
Hi,

You can do it this way for one Checkbox

''''''''''''''' '''Create object at the form level
Private objchk As New System.Windows. Forms.CheckBox( )

objchk .Name = "CheckBox1"
objchk .Visible = True
objchk .Checked = False
Me.Controls.Add (objchk)

''''''''''''''' Access the checked status using in some Event as
objchk.Checked

''''''''''''''' ''''''''''Or
for i=0 to form.controls.c ount
if Me.Controls(i). GetType().Name= "CheckBox" then
''''''''''''''' Access the checked status
end if
next
Mar 15 '07 #3
vinylason
9 New Member
I have done as you said but still i cant get the status because if we call another event the page gets refreshed and the dynamic controls are created again. So the checked status cant be found.
Thanks for ur help
Mar 29 '07 #4
vinylason
9 New Member
And finally i got the answer to find the checked status of dynamically created check box.
We have to put the code of creating checkboxes in the page load event, and now we can get the checked status of those checkboxes in other event
Mar 29 '07 #5

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

Similar topics

15
2955
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting it. Simple database: I want to have a user enter Supply Orders (just for tracking purposes) by Item. The user may also enter a new item - "new" is a combination of Item, PartNumber and Vendor - they could have the
8
4309
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image button at runtime: //----- Code snippet protected System.Web.UI.WebControls.PlaceHolder ImageHolder; private void Page_Load(object sender, System.EventArgs e)
3
7813
by: renil | last post by:
I have a repeater control that displays info. from a datatable. Each row in the repeater has a checkbox. Also, I have a delete linkbutton outside the repeater control. What I'm trying to do when the delete linkbutton is clicked is get the SubscriptionID from the repeater control for each row in which the checkbox is checked, then call a delete function. (See the code for the .aspx and .aspx.cs below.) The problem I'm having is that I...
1
2722
by: Dan H | last post by:
I have been able to add controls dyanmically to a windows application. And I can get the Click event working beautifully. But now I want to use an another event to change the state of the check box but I can seem to figure out how to work with the control. So in the code below I create a bunch of check boxes and I want the event called IFK_InputChange (where I have an external hardware device that I use as IFK, it works no problems) to...
1
4103
by: Kevin R | last post by:
This is one of the weirdest problems I have ever run into. I have had to trim down a bunch of code to give a sample that is more easily readable by those who will view this. Here is the problem: I dynamically add an htmlcheckbox to a webform in the pages render and set the checked value to true. When the page loads, if I remove the check from the checkbox and then submit it, in the submit event the checkbox' checked value is still...
2
2317
by: Aaron Reimann | last post by:
I have a lot of check boxes. This is an update of the check boxes, I want something was checked, then to do an insert (which is currently working), if something is no longer checked...delete the checkbox join/link that is in the database. So, the insert/checked is working, but the "unchecking" is not working. I don't know how to compare an array of what was not checked. Here is my code: if (is_array($_POST)) {
10
18917
by: Bishman | last post by:
Hi, I need to programmatically allow or disallow the selection of multiple checkboxes on a form . At certain times I only want to allow a single selection, at other times I may wish to allow multiple. Is there a way of doing this ? I dont want to use Radio buttons..... Thanks,
7
1598
by: jodleren | last post by:
Hi all! I have a problem - I have a list of checkboxes, with certain data... the point is, that some of them are set, and the important thing for mere is to get those values, which have changed from CHECKED to NOT CHECKED. Certain values are marked, once done, the user removes the flags, and I need to know what was set to not being checked anymore (to remove them from the task list).
5
3675
by: bjwest | last post by:
I'm writing a windows mobile app that uses dynamiclly created checkboxes. I'm having trouble getting the checked status. public void Add_CheckBox(String CBText) { CheckBox MyCheckbox = new CheckBox(); MyCheckbox.Location = new System.Drawing.Point(4, CB_Row * 20); MyCheckbox.Name = "MycheckBox" + CB_Row; MyCheckbox.Text = CBText; MyCheckbox.Font = NormalFont; ...
0
8203
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8711
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
8642
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
8368
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
8512
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
7203
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
5576
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
4206
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1815
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.