Results 1 to 5 of 5

Thread: Copy a form object into another

Threaded View

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Copy a form object into another

    Hello everybody,

    I need to maintain whether data on a screen has been changed or not. If data has been changed, then I need to give a pop-up warning on form close that your unsaved data will be lost, do you wish to continue.

    For performing this, I created a generic function which takes two arguments of System.Windows.Forms.Form type. Then I iterate through all the controls and perform one-to-one checking with textbox text property, listbox selectedindex and so on. After performing this check, method return true or false.

    The main thing is that when something on the form chages, I need to create a copy of the current state of the form in a form object. On close, call the function supplying two arguments, one is the state that was saved and other is the actual form that is this.

    How do I save the state of the form, means when user types something or perform any changes, I need to copy the form into another object with the properties of data loaded in it.

    Any ideas ??
    Last edited by usamaalam; Jun 3rd, 2005 at 01:51 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width