Alerting a main application form that a user setting has been changed

Hi experts,
  I am writing an application using MS Visual C# Express Beta, that has a modeless configuration form so that the user can change various application settings.  These settings modify the state of the values contained in 'Properties.Settings1.Value.xxx'.
  Is there any way to alert the main form to any changes that have been made to the user settings so that it can change its behaviour of say the com port used for the serialPort class?
  By the way I would describe myself as a relative beginner to C#.Net

Cheers
MillambaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gioni_goCommented:
using System;
/*Ok for this u have to use events . If u dont know what they are
 * I'll try to eplain to u a little bit .First of all there
 * are three componets in programming event driven apps.
 *First ---is  of them is YourEventArgs (the arguments passed by
 *your event)
 *Second---is the event handler (wich is a delegate)
 *Third --- is the actual event
 *OK let's start
 *
*/
namespace Proj
{
      //////////////////////////////////////////////////////////////////
      public class CustomEventArgs:EventArgs //always must derive from
      {                                                            //this base class
            public CustomEventArgs(string type_OfChange,string value_ofch)
            {//the class constructor
                  this.type_change = type_OfChange;
                  this.value_change= value_ofch;
            }
            public readonly string type_change,value_change;
            //they must be readonly so that they can only be read
      }
      //////////////////////////////////////////////////////////////////
      
      //////////////////////////////////////////////////////////////////
      public delegate void CustomEventHandler(CustomEventArgs args);
      //we defined our delegate = pointer to a function (in c++)
      //////////////////////////////////////////////////////////////////
      
      public class Test//:Form
      {
            //let's say this is the Form class u're gonna use
            //u're gonna define a custom event like this
            public event CustomEventHandler EventYouWaitFor;
            public Test()
            {
                  
            }
            public void TheGuyCheckedTheBox()
            {
                  OnCustomEvent(new CustomEventArgs("BlackCheckBox","Checked"));
            }
            //Now we're gonna make the function that fires the event
            protected void OnCustomEvent(CustomEventArgs args)
            {
                  if(EventYouWaitFor != null)
                  {
                        EventYouWaitFor(args);
                  }
            }
      }

      public class Tester
      {
            public static void Main(String[] args)
            {
            //ok now we test app
                  Test tst = new Test();
                  tst.EventYouWaitFor += new CustomEventHandler(doOnEvent);

                  //Now when the guy presses the checkbox u get the values
                  // I already put them for u in the function
                  tst.TheGuyCheckedTheBox();
            //and voila the result
                  // U really must read a little bit about delegates and events
                  // they are scary but they are easy to understand

                  Console.ReadLine();
            }

            public static void doOnEvent(CustomEventArgs args)
            {
            Console.WriteLine(args.type_change);
                  Console.WriteLine(args.value_change);
            }
      }
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.