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. clean form1 with button the other form2 calling a class

clean form1 with button the other form2 calling a class

Scheduled Pinned Locked Moved C#
csharp
3 Posts 2 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.
  • A Offline
    A Offline
    antonio_dsanchez
    wrote on last edited by
    #1

    hi all I developing a program in c#, I have two form. in the form1 I have a texbox, label and combobox, and in the second form I have a button the name cleaning and the class clean.I need is calling me class clean with me button clean and cleaning the form 1

    OriginalGriffO 1 Reply Last reply
    0
    • A antonio_dsanchez

      hi all I developing a program in c#, I have two form. in the form1 I have a texbox, label and combobox, and in the second form I have a button the name cleaning and the class clean.I need is calling me class clean with me button clean and cleaning the form 1

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Sorry? That doesn't make a whole lot of sense - what does your Clean class have to do with Form1? If you mean "I want to press a button on Form2, and it empties the data on Form1" then it depends who opened what. IF Form1 opened Form2, then you need an event in Form2, which is handled in Form1: Transferring information between two forms, Part 2: Child to Parent[^] - Form1 then clears out it's own fields. If Form2 opened Form1, then use a method in Form1 which is called from Form2, and which clear out teh info: Transferring information between two forms, Part 1: Parent to Child[^] - the example uses a property, but a method is more appropriate. If neither of them knows about the existence of the other (i.e. both were opened from Form3) then combine the two methods: Transferring information between two forms, Part 3: Child to Child[^]

      Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      A 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Sorry? That doesn't make a whole lot of sense - what does your Clean class have to do with Form1? If you mean "I want to press a button on Form2, and it empties the data on Form1" then it depends who opened what. IF Form1 opened Form2, then you need an event in Form2, which is handled in Form1: Transferring information between two forms, Part 2: Child to Parent[^] - Form1 then clears out it's own fields. If Form2 opened Form1, then use a method in Form1 which is called from Form2, and which clear out teh info: Transferring information between two forms, Part 1: Parent to Child[^] - the example uses a property, but a method is more appropriate. If neither of them knows about the existence of the other (i.e. both were opened from Form3) then combine the two methods: Transferring information between two forms, Part 3: Child to Child[^]

        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

        A Offline
        A Offline
        antonio_dsanchez
        wrote on last edited by
        #3

        in my form1 I have a texbox and I want to clean from my button clean in my form 2 whit my class clean I think is the is the second opcion

        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