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