| | |
Button activate other button
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
If the code is run from more than one event, you should refactor it into a method:
You can also fire an event handler directly since it's just another method:
C++ Syntax (Toggle Plain Text)
void button1_Click(Object^ sender, EventArgs^ e) { // Stuff for button 1 Button2Stuff(); } void button2_Click(Object^ sender, EventArgs^ e) { Button2Stuff(); } void Button2Stuff() { // Stuff for button 2 }
C++ Syntax (Toggle Plain Text)
void button1_Click(Object^ sender, EventArgs^ e) { // Stuff for button 1 button2_Click(this, EventArgs::Empty); } void button2_Click(Object^ sender, EventArgs^ e) { // Stuff for button 2 }
Last edited by Radical Edward; May 6th, 2008 at 2:03 pm.
If at first you don't succeed, keep on sucking until you do succeed.
![]() |
Similar Threads
- code to activate submit button (Perl)
- Tkinter Button "Disable" ? (Python)
- Submit or action button (JavaScript / DHTML / AJAX)
- Java Swing Calculator program not running. It has 0 errors (Java)
- JIT debug error (Windows NT / 2000 / XP)
- submit button (JSP)
- Tab Control (C#)
- norton doesn't activate after trojan.tooso.j (Viruses, Spyware and other Nasties)
- Do I have a virus? (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: C++ console just flash a while
- Next Thread: C++ Priority Queue and Heap help
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





