Click here to Skip to main content
15,867,765 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting a Graphic into an Image Pin
leppie19-Sep-02 10:10
leppie19-Sep-02 10:10 
GeneralSOLUTION! Re: Getting a Graphic into an Image Pin
SandyWhite9020-Sep-02 9:24
SandyWhite9020-Sep-02 9:24 
GeneralEvent triger Pin
D Shen19-Sep-02 5:16
D Shen19-Sep-02 5:16 
GeneralRe: Event triger Pin
Paul Riley19-Sep-02 5:33
Paul Riley19-Sep-02 5:33 
GeneralRe: Event triger Pin
David Stone19-Sep-02 5:38
sitebuilderDavid Stone19-Sep-02 5:38 
GeneralRe: Event trigger Pin
D Shen19-Sep-02 8:16
D Shen19-Sep-02 8:16 
GeneralRe: Event trigger Pin
D Shen19-Sep-02 8:16
D Shen19-Sep-02 8:16 
GeneralRe: Event trigger Pin
Paul Riley19-Sep-02 9:28
Paul Riley19-Sep-02 9:28 
[All code in this message is untested]

D Shen wrote:
But if I would like to do little bit different for each text_changed event, how do I do? Can I attach more than one method for each event?

Yes, but it has to be done manually.

Go to the form constructor, right underneath TODO: Add any constructor code after InitializeComponent call and add something like the following:
this.textButtonX.TextChanged += new System.EventHandler(this.MySecondaryMethod);
However, be careful. If you attach two methods to one Delegate, I can't guarantee what order they will run in or even that they will run in the same sequence each time. A lot of testing is in order here.

Unless the extra code is unrelated and it doesn't matter which sequence you run in, it might be much safer to simply have a method that works like this:
private bool AllEmpty()
{
    return ((textBox1.Text.Length + textBox2.Text.Length + textBox3.Text.Length) == 0)
}
then use
button1.Enabled = !AllEmpty()
in three different event handlers.



Paul
GeneralRe: Event triger Pin
Shaun Wilde19-Sep-02 11:14
Shaun Wilde19-Sep-02 11:14 
GeneralRe: Event triger Pin
Paul Riley19-Sep-02 11:26
Paul Riley19-Sep-02 11:26 
GeneralRe: Event triger Pin
David Stone19-Sep-02 5:36
sitebuilderDavid Stone19-Sep-02 5:36 
GeneralRe: Event triger Pin
leppie19-Sep-02 5:47
leppie19-Sep-02 5:47 
GeneralRe: Event triger Pin
D Shen19-Sep-02 8:17
D Shen19-Sep-02 8:17 
GeneralRe: Event triger Pin
leppie19-Sep-02 8:37
leppie19-Sep-02 8:37 
GeneralDataBound WebControl Pin
Shaun Wilde19-Sep-02 1:21
Shaun Wilde19-Sep-02 1:21 
GeneralRe: DataBound WebControl Pin
James T. Johnson19-Sep-02 1:36
James T. Johnson19-Sep-02 1:36 
GeneralRe: DataBound WebControl Pin
Shaun Wilde19-Sep-02 1:48
Shaun Wilde19-Sep-02 1:48 
GeneralRe: DataBound WebControl Pin
James T. Johnson19-Sep-02 2:01
James T. Johnson19-Sep-02 2:01 
GeneralRe: DataBound WebControl Pin
Shaun Wilde19-Sep-02 2:26
Shaun Wilde19-Sep-02 2:26 
GeneralRe: DataBound WebControl Pin
Shaun Wilde19-Sep-02 11:09
Shaun Wilde19-Sep-02 11:09 
GeneralBeginner C# questions Pin
vivosh197818-Sep-02 22:55
vivosh197818-Sep-02 22:55 
GeneralRe: Beginner C# questions Pin
leppie18-Sep-02 23:38
leppie18-Sep-02 23:38 
GeneralRe: Beginner C# questions Pin
James T. Johnson19-Sep-02 0:06
James T. Johnson19-Sep-02 0:06 
GeneralRe: Beginner C# questions Pin
leppie19-Sep-02 0:31
leppie19-Sep-02 0:31 
GeneralDataGrid Pin
vikramlinux18-Sep-02 18:03
vikramlinux18-Sep-02 18:03 

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.