Click here to Skip to main content
16,004,924 members
Home / Discussions / C#
   

C#

 
AnswerRe: Download multiple files? Pin
Scott Dorman12-Sep-07 8:18
professionalScott Dorman12-Sep-07 8:18 
QuestionRe: Download multiple files? Pin
bug_aonz12-Sep-07 17:11
bug_aonz12-Sep-07 17:11 
AnswerRe: Download multiple files? Pin
Scott Dorman13-Sep-07 4:16
professionalScott Dorman13-Sep-07 4:16 
GeneralRe: Download multiple files? Pin
bug_aonz13-Sep-07 16:56
bug_aonz13-Sep-07 16:56 
QuestionHow to check in form2 if a button on form1 has been clicked Pin
Lucy12-Sep-07 0:20
Lucy12-Sep-07 0:20 
AnswerRe: How to check in form2 if a button on form1 has been clicked Pin
blackjack215012-Sep-07 0:33
blackjack215012-Sep-07 0:33 
GeneralRe: How to check in form2 if a button on form1 has been clicked Pin
Lucy12-Sep-07 0:54
Lucy12-Sep-07 0:54 
AnswerRe: How to check in form2 if a button on form1 has been clicked Pin
Malcolm Smart12-Sep-07 1:00
Malcolm Smart12-Sep-07 1:00 
Events and delegates.

Either get Form2 to subscribe to Form1.Button's onclick event or capture the onclick event on form1 and tell Form2 it has been clicked using a delegate :-

<br />
//in form1<br />
public Event Eventhandler OnButton1Click;<br />
<br />
void form1_buttonClicked( objects sender , EventArgs args)<br />
{<br />
   //handler tied to the actual button click on form 1<br />
   //do other stuff<br />
<br />
   //tell any subscribers we've been clicked<br />
   if (OnButton1Click != null)<br />
     OnButton1Click( sender , args );<br />
}<br />



<br />
///form2<br />
<br />
public void MyHandler( object sender , EventArgs args)<br />
{<br />
///button on form1 has been clicked<br />
}<br />
<br />
<br />
//in ctor or some initialiser of Form2<br />
<br />
form1.OnButton1Click += MyHandler;<br />
<br />





"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF


"I haven't spoken to my wife now for 48 hours. I don't like to interrupt her.

AnswerRe: How to check in form2 if a button on form1 has been clicked Pin
Xmen Real 12-Sep-07 1:24
professional Xmen Real 12-Sep-07 1:24 
GeneralRe: How to check in form2 if a button on form1 has been clicked Pin
Lucy12-Sep-07 1:29
Lucy12-Sep-07 1:29 
GeneralRe: How to check in form2 if a button on form1 has been clicked Pin
Xmen Real 12-Sep-07 1:31
professional Xmen Real 12-Sep-07 1:31 
GeneralRe: How to check in form2 if a button on form1 has been clicked Pin
Lucy12-Sep-07 1:32
Lucy12-Sep-07 1:32 
GeneralRe: How to check in form2 if a button on form1 has been clicked Pin
Xmen Real 12-Sep-07 1:35
professional Xmen Real 12-Sep-07 1:35 
GeneralRe: How to check in form2 if a button on form1 has been clicked Pin
Pete O'Hanlon12-Sep-07 1:49
mvePete O'Hanlon12-Sep-07 1:49 
AnswerRe: How to check in form2 if a button on form1 has been clicked Pin
Anthony Mushrow12-Sep-07 2:02
professionalAnthony Mushrow12-Sep-07 2:02 
AnswerRe: How to check in form2 if a button on form1 has been clicked Pin
Paras Kaneriya12-Sep-07 22:32
Paras Kaneriya12-Sep-07 22:32 
Question[Message Deleted] Pin
P_Elza12-Sep-07 0:12
P_Elza12-Sep-07 0:12 
AnswerRe: Go to a particular node. Pin
Mark Churchill12-Sep-07 0:14
Mark Churchill12-Sep-07 0:14 
GeneralRe: Go to a particular node. Pin
P_Elza12-Sep-07 0:56
P_Elza12-Sep-07 0:56 
AnswerRe: Go to a particular node. Pin
Xmen Real 12-Sep-07 1:29
professional Xmen Real 12-Sep-07 1:29 
GeneralRe: Go to a particular node. Pin
P_Elza12-Sep-07 2:12
P_Elza12-Sep-07 2:12 
AnswerRe: Go to a particular node. Pin
Scott Dorman12-Sep-07 8:20
professionalScott Dorman12-Sep-07 8:20 
GeneralRe: Go to a particular node. [modified] Pin
P_Elza12-Sep-07 17:01
P_Elza12-Sep-07 17:01 
QuestionHash Table Pin
Nishad8512-Sep-07 0:07
Nishad8512-Sep-07 0:07 
AnswerRe: Hash Table Pin
mertkan6512-Sep-07 21:13
mertkan6512-Sep-07 21:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.