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

Get CheckBox value from one form in another form.

I made the chkbox public in designer.
Then tried to access the checked property in the form.But it always shows"False" irrespective of the checked state of the control
Oct 12 '10 #1
5 7339
I have had problem accessing designer components from another form. I your case I would create a public Boolean and set it based on checkbox, then check the public Boolean from the other form.
Oct 12 '10 #2
The public var in source form contains the value(true/false) based on the checked prop. But in the destination form it always has the default value as false(initialised value).
Oct 12 '10 #3
Curtis Rutland
3,256 Expert 2GB
That's because you're probably creating a new instance of the parent form in the child. You need to pass a reference, not create a new one.

Also, don't create a public bool attribute, use a property:
Expand|Select|Wrap|Line Numbers
  1. public bool PropertyName{
  2.   get { return someCheckBox.Checked; } 
  3.   //if you want to be able to set it as well,
  4.   //uncomment the next line
  5.   //set { someCheckBox.Checked = value; } 
  6. }
Oct 12 '10 #4
Thanks. It worked.
Oct 13 '10 #5
Create an object for form1 and send the checked value of the particular check box from form2 to form1 using the form1 object.

Web Development Services
Oct 14 '10 #6

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

Similar topics

1
by: Michael S. Montoya | last post by:
I need to have a form's routine run from another form...here is an example: frmContacts is loaded. The user double-clicks cboCompanyID to open frmCompany frmCompany displays other contacts for...
0
by: Michael Mitchell via DotNetMonster.com | last post by:
* I need to collect the input data on example1.aspx by hitting the review button. * Out put the data in the corresponding Labels on Example2.aspx. * Save Example2.aspx to a File of the users choice...
1
by: Robert Smith | last post by:
Hello, I have a form called MyForm, say, and I wish the title (i.e. the text property) of this form to be updated from another form when say the current business changes. Since the form isn't...
3
by: feeman | last post by:
What I am looking at doing is I have a couple of forms, when I enter the number of products been despatched on the order form, it then creates a record in the transaction table and also the product...
5
by: Zaccy | last post by:
i have a form where the user inputs text in a text box and then click a button saying continue then i have another form where the user inputs more text and clicks a button saying continue i want the...
0
by: hitech | last post by:
in c#, i have added some items to the listbox of form1. now i want to pass these items to dropdown box of form2. in form2, i made the object of form1 named f4. then i wrote this line:-...
1
by: viranadim | last post by:
I am having problems with attempting to filter a form based on criteria selected in a combo box from another form. I am attempting to filter a form called "Ford CheckList" that is based on a table...
5
by: caconklin | last post by:
Access 2003, Windows XP. Currently I am able to open a form - case form - based upon information input by the user in another form - search form. I would like to be able to open the case form...
2
by: timr30017 | last post by:
I am new to VB.net but I am trying to recreate an old program in .net and learn as I go so any help will be greatly appreciated. I have one form with a datagrid that displays a list of 'contacts'...
4
by: Jamen98 | last post by:
I'm trying to pass the "ADA_Member_Factor" variable from on form to another. The first form that puts a value in the variable is below: Option Compare Database Dim ADA_Member_Factor As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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?
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
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,...
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,...
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.