/* W O R K I N G W I T H M D I P R O J E C T S Manager Form Ron Kessler Created 11/05/2014 This form represents manager activites and displays the current customer from the properties in the General Class I use a timer control to listen for changes in the name so we can refresh the customer name on this form. It checks every 1 second on a separate thread so you won't notice any freezing on the forms! _____________________________________________________ Updated 11/6/2014 Final tests seem ok */ #pragma once #include "General.h"; //add this so we can access this class private: System::Void frmManager_Load(System::Object^ sender, System::EventArgs^ e) { //Let's show something in customer label to start with. See default in General class StringBuilder^ sb = gcnew StringBuilder(); sb->Append(General::FirstName->ToString()); sb->Append(" "); sb->Append(General::LastName); this->lblCustomer->Text = sb->ToString(); } private: System::Void btnClear_Click(System::Object^ sender, System::EventArgs^ e) { //---cycle through the controls and uncheck the checkboxes for each(Control^ whichControl in this->Controls) if(whichControl->GetType() == System::Windows::Forms::CheckBox::typeid) { //---you must cast the generic control to a checkbox to access the checked property CheckBox^ myCheckbox = safe_cast(whichControl); myCheckbox->Checked=false; } /*---NOTE: safe_cast is used when you know the cast operation won't fail. The generic object 'whichControl' does not have a checked property so we have to cast it into a checkbox.*/ }