Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Form closing issue

Form closing issue

Scheduled Pinned Locked Moved C#
help
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Neo Andreson
    wrote on last edited by
    #1

    On closing the form i need to save some data so in which event should i call the function to save data. i am doing it inside Form1_FormClosed(); but if the data is not proper it should return from there..it is returning but closing the form. Is there any handler which gets called before Form1_FormClosed() event. ThankXXX In Advance.

    Truth Is The Simplest !!!!

    L V 2 Replies Last reply
    0
    • N Neo Andreson

      On closing the form i need to save some data so in which event should i call the function to save data. i am doing it inside Form1_FormClosed(); but if the data is not proper it should return from there..it is returning but closing the form. Is there any handler which gets called before Form1_FormClosed() event. ThankXXX In Advance.

      Truth Is The Simplest !!!!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      FormClosing...:)

      1 Reply Last reply
      0
      • N Neo Andreson

        On closing the form i need to save some data so in which event should i call the function to save data. i am doing it inside Form1_FormClosed(); but if the data is not proper it should return from there..it is returning but closing the form. Is there any handler which gets called before Form1_FormClosed() event. ThankXXX In Advance.

        Truth Is The Simplest !!!!

        V Offline
        V Offline
        Vikram A Punathambekar
        wrote on last edited by
        #3

        You can write that code in FormClosing() and set the FormClosingEventArgs.Cancel property to true. I don't mean to be harsh, but the very first result for cancel formclosed[^] brings up the answer.

        Cheers, Vikram.


        "I will put my new found knolage to good use" - Captain See Sharp. "Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups