473,672 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with eventhandlers (!?)

I have a client server app. On the client i have buttons (derived from user
contol) that let user perform actions when they are connected to the server.
so when they connect (using a menuitem) i add event handlers to the buttons
and when they disconnect i remove them. Now, everything works fine when
they connnect for the first time. All of the msgs are sent propoerly by the
client. To figure out what button is click by the client i used the "Tag"
property rather than having a on click event for each of the buttons ( see
click event code).

However, if the following scenario occurs it goes through both msgs(like
kind of having two event handlers for button click being executed)
connect -> disconnect->connect.
can someone please tell me what could be worng? only think i can think
about is something to do with event handlers thats it :(
------------------------------------------
i am only adding handlers once with every connect msg as follows:
private void SetupFunctionBu ttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover +=new EventHandler(bt n_MouseHover);
btn.MouseLeave +=new EventHandler(bt n_MouseLeave);
btn.MouseEnter +=new EventHandler(bt n_MouseEnter);
btn.MouseUp +=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown +=new MouseEventHandl er(btn_MouseDow n);
btn.Click +=new EventHandler(bt n_Click);
}
btnEmpty1.Image Index = 1;
btnEmpty2.Image Index = 1;
}
------------------------------------------
I know i am removing all handlers every time they disconnect (b/c u can t
click or do anyting with the button)

private void RemoveFunctionB uttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover -=new EventHandler(bt n_MouseHover);
btn.MouseLeave -=new EventHandler(bt n_MouseLeave);
btn.MouseEnter -=new EventHandler(bt n_MouseEnter);
btn.MouseUp -=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown -=new MouseEventHandl er(btn_MouseDow n);
btn.Click -=new EventHandler(bt n_Click);
}
}

------------------------------------------

private void btn_Click(objec t sender, EventArgs e)
{
Carets.HideCare t(this.Handle);
WACButton btn = (WACButton)send er;
btn.ImageIndex = 3;
Thread.Sleep(20 0);
string tag = ((WACButton)sen der).Tag.ToStri ng();
try
{
switch(tag)
{
case "dnd":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDON
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "Disable DND";
btn.Tag = "disablednd ";
break;
}
case "disablednd ":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDOFF
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "DND";
btn.Tag = "dnd";
break;
}

}//end case//
}
catch
{
return;
}
Carets.ShowCare t(this.Handle);
}
Nov 17 '05 #1
5 1436
Hi,

It's not clear to me why you add/remove the handlers, I would instead use a
flag to indicate if they should react to the events or not. In your case
even the Enabled/ property can be used.

If that is not enough, then create ONLY ONE isntance of each event and just
assign it as needed:

EventHandler m_mouseHover;

mouseHover = new EventHandler(bt n_MouseHover);

// to hook
btn.MouseHover += mouseHover ;
// to unhook
btn.MouseHover -= mouseHover ;
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"Raj Chudasama" <ra*@asteriasgi .com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I have a client server app. On the client i have buttons (derived from
user contol) that let user perform actions when they are connected to the
server. so when they connect (using a menuitem) i add event handlers to the
buttons and when they disconnect i remove them. Now, everything works fine
when they connnect for the first time. All of the msgs are sent propoerly
by the client. To figure out what button is click by the client i used the
"Tag" property rather than having a on click event for each of the buttons
( see click event code).

However, if the following scenario occurs it goes through both msgs(like
kind of having two event handlers for button click being executed)
connect -> disconnect->connect.
can someone please tell me what could be worng? only think i can think
about is something to do with event handlers thats it :(
------------------------------------------
i am only adding handlers once with every connect msg as follows:
private void SetupFunctionBu ttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover +=new EventHandler(bt n_MouseHover);
btn.MouseLeave +=new EventHandler(bt n_MouseLeave);
btn.MouseEnter +=new EventHandler(bt n_MouseEnter);
btn.MouseUp +=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown +=new MouseEventHandl er(btn_MouseDow n);
btn.Click +=new EventHandler(bt n_Click);
}
btnEmpty1.Image Index = 1;
btnEmpty2.Image Index = 1;
}
------------------------------------------
I know i am removing all handlers every time they disconnect (b/c u can t
click or do anyting with the button)

private void RemoveFunctionB uttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover -=new EventHandler(bt n_MouseHover);
btn.MouseLeave -=new EventHandler(bt n_MouseLeave);
btn.MouseEnter -=new EventHandler(bt n_MouseEnter);
btn.MouseUp -=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown -=new MouseEventHandl er(btn_MouseDow n);
btn.Click -=new EventHandler(bt n_Click);
}
}

------------------------------------------

private void btn_Click(objec t sender, EventArgs e)
{
Carets.HideCare t(this.Handle);
WACButton btn = (WACButton)send er;
btn.ImageIndex = 3;
Thread.Sleep(20 0);
string tag = ((WACButton)sen der).Tag.ToStri ng();
try
{
switch(tag)
{
case "dnd":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDON
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "Disable DND";
btn.Tag = "disablednd ";
break;
}
case "disablednd ":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDOFF
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "DND";
btn.Tag = "dnd";
break;
}

}//end case//
}
catch
{
return;
}
Carets.ShowCare t(this.Handle);
}

Nov 17 '05 #2
Hi, thanks for reply

thants what i am doing, i have one instance of each event. All buttons get
these events assigned to them. so use switch statement to figure out which
button was clicked. It works well, except the problem i stated. They are
basically disabled when they are not connected to the server, since there
are no event handlers assigned to them..

i will try some sort of flag.

thanks



"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

It's not clear to me why you add/remove the handlers, I would instead use
a flag to indicate if they should react to the events or not. In your case
even the Enabled/ property can be used.

If that is not enough, then create ONLY ONE isntance of each event and
just assign it as needed:

EventHandler m_mouseHover;

mouseHover = new EventHandler(bt n_MouseHover);

// to hook
btn.MouseHover += mouseHover ;
// to unhook
btn.MouseHover -= mouseHover ;
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"Raj Chudasama" <ra*@asteriasgi .com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I have a client server app. On the client i have buttons (derived from
user contol) that let user perform actions when they are connected to the
server. so when they connect (using a menuitem) i add event handlers to
the buttons and when they disconnect i remove them. Now, everything works
fine when they connnect for the first time. All of the msgs are sent
propoerly by the client. To figure out what button is click by the client
i used the "Tag" property rather than having a on click event for each of
the buttons ( see click event code).

However, if the following scenario occurs it goes through both msgs(like
kind of having two event handlers for button click being executed)
connect -> disconnect->connect.
can someone please tell me what could be worng? only think i can think
about is something to do with event handlers thats it :(
------------------------------------------
i am only adding handlers once with every connect msg as follows:
private void SetupFunctionBu ttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover +=new EventHandler(bt n_MouseHover);
btn.MouseLeave +=new EventHandler(bt n_MouseLeave);
btn.MouseEnter +=new EventHandler(bt n_MouseEnter);
btn.MouseUp +=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown +=new MouseEventHandl er(btn_MouseDow n);
btn.Click +=new EventHandler(bt n_Click);
}
btnEmpty1.Image Index = 1;
btnEmpty2.Image Index = 1;
}
------------------------------------------
I know i am removing all handlers every time they disconnect (b/c u can t
click or do anyting with the button)

private void RemoveFunctionB uttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover -=new EventHandler(bt n_MouseHover);
btn.MouseLeave -=new EventHandler(bt n_MouseLeave);
btn.MouseEnter -=new EventHandler(bt n_MouseEnter);
btn.MouseUp -=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown -=new MouseEventHandl er(btn_MouseDow n);
btn.Click -=new EventHandler(bt n_Click);
}
}

------------------------------------------

private void btn_Click(objec t sender, EventArgs e)
{
Carets.HideCare t(this.Handle);
WACButton btn = (WACButton)send er;
btn.ImageIndex = 3;
Thread.Sleep(20 0);
string tag = ((WACButton)sen der).Tag.ToStri ng();
try
{
switch(tag)
{
case "dnd":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDON
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "Disable DND";
btn.Tag = "disablednd ";
break;
}
case "disablednd ":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDOFF
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "DND";
btn.Tag = "dnd";
break;
}

}//end case//
}
catch
{
return;
}
Carets.ShowCare t(this.Handle);
}


Nov 17 '05 #3
Hi,

They are not disabled, just they do nothing, but it may annoy the user, just
disable them.

and use one eventhandler, do not create them without reason.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Raj Chudasama" <ra*@asteriasgi .com> wrote in message
news:uc******** ******@TK2MSFTN GP14.phx.gbl...
Hi, thanks for reply

thants what i am doing, i have one instance of each event. All buttons
get these events assigned to them. so use switch statement to figure out
which button was clicked. It works well, except the problem i stated.
They are basically disabled when they are not connected to the server,
since there are no event handlers assigned to them..

i will try some sort of flag.

thanks



"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

It's not clear to me why you add/remove the handlers, I would instead use
a flag to indicate if they should react to the events or not. In your
case even the Enabled/ property can be used.

If that is not enough, then create ONLY ONE isntance of each event and
just assign it as needed:

EventHandler m_mouseHover;

mouseHover = new EventHandler(bt n_MouseHover);

// to hook
btn.MouseHover += mouseHover ;
// to unhook
btn.MouseHover -= mouseHover ;
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"Raj Chudasama" <ra*@asteriasgi .com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I have a client server app. On the client i have buttons (derived from
user contol) that let user perform actions when they are connected to the
server. so when they connect (using a menuitem) i add event handlers to
the buttons and when they disconnect i remove them. Now, everything
works fine when they connnect for the first time. All of the msgs are
sent propoerly by the client. To figure out what button is click by the
client i used the "Tag" property rather than having a on click event for
each of the buttons ( see click event code).

However, if the following scenario occurs it goes through both msgs(like
kind of having two event handlers for button click being executed)
connect -> disconnect->connect.
can someone please tell me what could be worng? only think i can think
about is something to do with event handlers thats it :(
------------------------------------------
i am only adding handlers once with every connect msg as follows:
private void SetupFunctionBu ttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover +=new EventHandler(bt n_MouseHover);
btn.MouseLeave +=new EventHandler(bt n_MouseLeave);
btn.MouseEnter +=new EventHandler(bt n_MouseEnter);
btn.MouseUp +=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown +=new MouseEventHandl er(btn_MouseDow n);
btn.Click +=new EventHandler(bt n_Click);
}
btnEmpty1.Image Index = 1;
btnEmpty2.Image Index = 1;
}
------------------------------------------
I know i am removing all handlers every time they disconnect (b/c u can
t click or do anyting with the button)

private void RemoveFunctionB uttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover -=new EventHandler(bt n_MouseHover);
btn.MouseLeave -=new EventHandler(bt n_MouseLeave);
btn.MouseEnter -=new EventHandler(bt n_MouseEnter);
btn.MouseUp -=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown -=new MouseEventHandl er(btn_MouseDow n);
btn.Click -=new EventHandler(bt n_Click);
}
}

------------------------------------------

private void btn_Click(objec t sender, EventArgs e)
{
Carets.HideCare t(this.Handle);
WACButton btn = (WACButton)send er;
btn.ImageIndex = 3;
Thread.Sleep(20 0);
string tag = ((WACButton)sen der).Tag.ToStri ng();
try
{
switch(tag)
{
case "dnd":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDON
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "Disable DND";
btn.Tag = "disablednd ";
break;
}
case "disablednd ":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDOFF
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "DND";
btn.Tag = "dnd";
break;
}

}//end case//
}
catch
{
return;
}
Carets.ShowCare t(this.Handle);
}



Nov 17 '05 #4
HI tanks again

those event handlers sort of give it some nice looks. For each event
(mouseevent) i change buttons so it sort has that look of macro media flash
app.

i still can t seem to figure out why it executes click event twice.
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:Oy******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

They are not disabled, just they do nothing, but it may annoy the user,
just disable them.

and use one eventhandler, do not create them without reason.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Raj Chudasama" <ra*@asteriasgi .com> wrote in message
news:uc******** ******@TK2MSFTN GP14.phx.gbl...
Hi, thanks for reply

thants what i am doing, i have one instance of each event. All buttons
get these events assigned to them. so use switch statement to figure out
which button was clicked. It works well, except the problem i stated.
They are basically disabled when they are not connected to the server,
since there are no event handlers assigned to them..

i will try some sort of flag.

thanks



"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

It's not clear to me why you add/remove the handlers, I would instead
use a flag to indicate if they should react to the events or not. In
your case even the Enabled/ property can be used.

If that is not enough, then create ONLY ONE isntance of each event and
just assign it as needed:

EventHandler m_mouseHover;

mouseHover = new EventHandler(bt n_MouseHover);

// to hook
btn.MouseHover += mouseHover ;
// to unhook
btn.MouseHover -= mouseHover ;
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"Raj Chudasama" <ra*@asteriasgi .com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I have a client server app. On the client i have buttons (derived from
user contol) that let user perform actions when they are connected to
the server. so when they connect (using a menuitem) i add event handlers
to the buttons and when they disconnect i remove them. Now, everything
works fine when they connnect for the first time. All of the msgs are
sent propoerly by the client. To figure out what button is click by the
client i used the "Tag" property rather than having a on click event for
each of the buttons ( see click event code).

However, if the following scenario occurs it goes through both
msgs(like kind of having two event handlers for button click being
executed)
connect -> disconnect->connect.
can someone please tell me what could be worng? only think i can think
about is something to do with event handlers thats it :(
------------------------------------------
i am only adding handlers once with every connect msg as follows:
private void SetupFunctionBu ttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover +=new EventHandler(bt n_MouseHover);
btn.MouseLeave +=new EventHandler(bt n_MouseLeave);
btn.MouseEnter +=new EventHandler(bt n_MouseEnter);
btn.MouseUp +=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown +=new MouseEventHandl er(btn_MouseDow n);
btn.Click +=new EventHandler(bt n_Click);
}
btnEmpty1.Image Index = 1;
btnEmpty2.Image Index = 1;
}
------------------------------------------
I know i am removing all handlers every time they disconnect (b/c u can
t click or do anyting with the button)

private void RemoveFunctionB uttons()
{
foreach(WACButt on btn in Names)
{
btn.MouseHover -=new EventHandler(bt n_MouseHover);
btn.MouseLeave -=new EventHandler(bt n_MouseLeave);
btn.MouseEnter -=new EventHandler(bt n_MouseEnter);
btn.MouseUp -=new MouseEventHandl er(btn_MouseUp) ;
btn.MouseDown -=new MouseEventHandl er(btn_MouseDow n);
btn.Click -=new EventHandler(bt n_Click);
}
}

------------------------------------------

private void btn_Click(objec t sender, EventArgs e)
{
Carets.HideCare t(this.Handle);
WACButton btn = (WACButton)send er;
btn.ImageIndex = 3;
Thread.Sleep(20 0);
string tag = ((WACButton)sen der).Tag.ToStri ng();
try
{
switch(tag)
{
case "dnd":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDON
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "Disable DND";
btn.Tag = "disablednd ";
break;
}
case "disablednd ":
{
s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDOFF
UN|{1}^",mIRCRo om,mMyInfo.Name ));
btn.ButtonText = "DND";
btn.Tag = "dnd";
break;
}

}//end case//
}
catch
{
return;
}
Carets.ShowCare t(this.Handle);
}



Nov 17 '05 #5
Hi,

Even so, you can create the delegates only once, and regarding the
buttons( or menuitems ) do not create them each time you change the look,
create them once and just keep them in an array.

Create the minimun qty of instances needed, this way you will consume less
memory
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Raj Chudasama" <ra*@asteriasgi .com> wrote in message
news:OO******** ******@TK2MSFTN GP12.phx.gbl...
HI tanks again

those event handlers sort of give it some nice looks. For each event
(mouseevent) i change buttons so it sort has that look of macro media
flash app.

i still can t seem to figure out why it executes click event twice.
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
wrote in message news:Oy******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

They are not disabled, just they do nothing, but it may annoy the user,
just disable them.

and use one eventhandler, do not create them without reason.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Raj Chudasama" <ra*@asteriasgi .com> wrote in message
news:uc******** ******@TK2MSFTN GP14.phx.gbl...
Hi, thanks for reply

thants what i am doing, i have one instance of each event. All buttons
get these events assigned to them. so use switch statement to figure
out which button was clicked. It works well, except the problem i
stated. They are basically disabled when they are not connected to the
server, since there are no event handlers assigned to them..

i will try some sort of flag.

thanks



"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

It's not clear to me why you add/remove the handlers, I would instead
use a flag to indicate if they should react to the events or not. In
your case even the Enabled/ property can be used.

If that is not enough, then create ONLY ONE isntance of each event and
just assign it as needed:

EventHandler m_mouseHover;

mouseHover = new EventHandler(bt n_MouseHover);

// to hook
btn.MouseHover += mouseHover ;
// to unhook
btn.MouseHover -= mouseHover ;
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"Raj Chudasama" <ra*@asteriasgi .com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
>I have a client server app. On the client i have buttons (derived from
>user contol) that let user perform actions when they are connected to
>the server. so when they connect (using a menuitem) i add event
>handlers to the buttons and when they disconnect i remove them. Now,
>everythi ng works fine when they connnect for the first time. All of the
>msgs are sent propoerly by the client. To figure out what button is
>click by the client i used the "Tag" property rather than having a on
>click event for each of the buttons ( see click event code).
>
> However, if the following scenario occurs it goes through both
> msgs(like kind of having two event handlers for button click being
> executed)
> connect -> disconnect->connect.
> can someone please tell me what could be worng? only think i can
> think about is something to do with event handlers thats it :(
> ------------------------------------------
> i am only adding handlers once with every connect msg as follows:
> private void SetupFunctionBu ttons()
> {
> foreach(WACButt on btn in Names)
> {
> btn.MouseHover +=new EventHandler(bt n_MouseHover);
> btn.MouseLeave +=new EventHandler(bt n_MouseLeave);
> btn.MouseEnter +=new EventHandler(bt n_MouseEnter);
> btn.MouseUp +=new MouseEventHandl er(btn_MouseUp) ;
> btn.MouseDown +=new MouseEventHandl er(btn_MouseDow n);
> btn.Click +=new EventHandler(bt n_Click);
> }
> btnEmpty1.Image Index = 1;
> btnEmpty2.Image Index = 1;
> }
> ------------------------------------------
> I know i am removing all handlers every time they disconnect (b/c u
> can t click or do anyting with the button)
>
> private void RemoveFunctionB uttons()
> {
> foreach(WACButt on btn in Names)
> {
> btn.MouseHover -=new EventHandler(bt n_MouseHover);
> btn.MouseLeave -=new EventHandler(bt n_MouseLeave);
> btn.MouseEnter -=new EventHandler(bt n_MouseEnter);
> btn.MouseUp -=new MouseEventHandl er(btn_MouseUp) ;
> btn.MouseDown -=new MouseEventHandl er(btn_MouseDow n);
> btn.Click -=new EventHandler(bt n_Click);
> }
> }
>
> ------------------------------------------
>
> private void btn_Click(objec t sender, EventArgs e)
> {
> Carets.HideCare t(this.Handle);
> WACButton btn = (WACButton)send er;
> btn.ImageIndex = 3;
> Thread.Sleep(20 0);
> string tag = ((WACButton)sen der).Tag.ToStri ng();
> try
> {
> switch(tag)
> {
> case "dnd":
> {
> s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDON
> UN|{1}^",mIRCRo om,mMyInfo.Name ));
> btn.ButtonText = "Disable DND";
> btn.Tag = "disablednd ";
> break;
> }
> case "disablednd ":
> {
> s.IRCConnection .SendMessage(st ring.Format("PR IVMSG {0} :DNDOFF
> UN|{1}^",mIRCRo om,mMyInfo.Name ));
> btn.ButtonText = "DND";
> btn.Tag = "dnd";
> break;
> }
>
> }//end case//
> }
> catch
> {
> return;
> }
> Carets.ShowCare t(this.Handle);
> }
>



Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1486
by: Matthias Pieroth | last post by:
Hi NG, I have an OCX (VC++ 6.0) that fires some events. I have to use it on a form an have to catch the events in event-handlers in another form (MDI-Child). BUT: I have to create the other Form by Reflection, it is in a ClassLibrary that has to be loaded dynamically. I first tried it without the ClassLibrary and it works. I give the OCX to the Subform, declare my Eventhandlers there and bind the ocx to these eventhandlers, no problem,...
3
1879
by: Robert | last post by:
I need some assistance doing some "right way to do it" coding. The following are EventHandlers associated with Delegates in a child form that call a procedure in the MDI form that resets a timer. There must be a better way to code this than calling OnResetTimer in all these procedures separately. Is there not a way to use one handler for all of them? private void pnlCPI_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)...
1
3106
by: Pieter | last post by:
Hi, I have a custom List that inherits from BindingList. It has some methods overloaded, like the Add/Insert/etc to add and remove some eventhandlers when adding or removing an item T of the list. The problem happens when: - I use such a BindingList as DataSource for a BindingSource. - Add this BindingSource as DataSource for a DataGridView. - And go to the NewRow and add a new row in the DataGridView.
1
2361
by: Pieter | last post by:
Hi, I have a custom List that inherits from BindingList. It has some methods overloaded, like the Add/Insert/etc to add and remove some eventhandlers when adding or removing an item T of the list. The problem happens when: - I use such a BindingList as DataSource for a BindingSource. - Add this BindingSource as DataSource for a DataGridView. - And go to the NewRow and add a new row in the DataGridView.
4
5045
by: ICPooreMan | last post by:
I've got some code which works in firefox that's giving me fits in IE7 (maybe other versions too I haven't tested it). What I want to do is get the oncontextmenu attribute of something, change the value then put it back as the oncontextmenu attribute. Here's an example page if you want to try it out... <html> <head> <titletesting </title> <script><!--
0
8486
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8931
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.