Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a C++ Expert!

Join 244,281 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,147 people online right now. Registration is fast and FREE... Join Now!




check box help

 
Reply to this topicStart new topic

check box help, help with checkboxes in vc++.net

elven_shade
30 Dec, 2008 - 05:45 PM
Post #1

New D.I.C Head
*

Joined: 16 Feb, 2008
Posts: 5

im trying to write a program in vc++.net that uses the net stat function the lay out is designed to keep some of the features hidden unless the -s command is selected but i keep getting the error message of: "no identifier found for checkbox7_checked " here is the code im working with:
CODE
    
public: System::Void checkBox7_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {

if checkbox7_CheckedChanged()
                     checkbox11_visable = true
                     checkbox12_visable = true
                     checkbox13_visable = true
                     checkbox14_visable = true;
             }

i also tried this:
CODE

public: System::Void checkBox7_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {

if checkbox7_Checked = true                    
checkbox11_visable = true
                     checkbox12_visable = true
                     checkbox13_visable = true
                     checkbox14_visable = true;
             }


User is offlineProfile CardPM
+Quote Post


Martyr2
RE: Check Box Help
31 Dec, 2008 - 05:54 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 6,656



Thanked: 613 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
You have quite a few errors here so lets just correct them all up. First of all, you are missing the following...

1) You are missing some parenthesis in your if statement.

2) I am not sure why you have a checkchanged for checkbox7 in the if, the event fires if this checkbox is checked or unchecked.

3) Your if statement is missing an opening curly brace

4) Numerous statements are missing a semicolon on the end. Remember C++ requires semicolons on the end of all statements.

5) You are accessing properties all wrong.

So lets see if we can clean this up a bit....

cpp

public: System::Void checkBox7_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {

// Notice the parenthesis, also notice how we are accessing properties
// If checkbox7 is checked, execute the statements
if (checkbox7->Checked) {
// Notice we use ->Visible to access the visible property
// Also notice we have a semicolon on the end of each statement
checkbox11->Visible = true;
checkbox12->Visible = true;
checkbox13->Visible = true;
checkbox14->Visible = true;
} // <-- Here is our closing curly brace for the if statement
else {
// Do statements here for if the checkbox becomes unchecked
}
}


So now if the checkbox7 becomes checked then it will make the other checkboxes visible. In the else statement we can hide them all again if you like. This will be when checkbox7 becomes unchecked.

Hope this move you forward with the project. Good luck!

"At DIC we be checkbox checking check code ninjas... check on the check of checkboxes ol' buddy!" decap.gif

User is offlineProfile CardPM
+Quote Post

elven_shade
RE: Check Box Help
5 Jan, 2009 - 01:44 PM
Post #3

New D.I.C Head
*

Joined: 16 Feb, 2008
Posts: 5

thanks ill try this when i get home and post later the results this .net stuff kills me lol but i am in it because i took vb.net in school
i really am great full thanks again


p.s. i like the emoticon made me laugh

This post has been edited by elven_shade: 5 Jan, 2009 - 01:56 PM
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic

Time is now: 7/4/09 02:11PM

Live C++ Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month