473,320 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

eventhandler

might be a stupid question but
can i set an eventhandler for a variable?

regards Maarten
Nov 23 '05 #1
4 1106
Maarten,

Do you mean for any variable? No, you can not. If the instance of the
type of the variable exposes events, then you can attach to those, but in
general, no, you can not be notified when an arbitrary variable changes.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
might be a stupid question but
can i set an eventhandler for a variable?

regards Maarten

Nov 23 '05 #2
thanks,

yes i mean for all variables

for examle
string test = "test" ;

and then fix an eventhandler that starts if the content of the variable
changes.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uR**************@TK2MSFTNGP09.phx.gbl...
Maarten,

Do you mean for any variable? No, you can not. If the instance of the type of the variable exposes events, then you can attach to those, but in
general, no, you can not be notified when an arbitrary variable changes.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
might be a stupid question but
can i set an eventhandler for a variable?

regards Maarten


Nov 23 '05 #3
You could create a custom object and add event - handling to it. For an
example, see Darth Pedro's "ArrayList with Events" at godotnet.com:

http://www.gotdotnet.com/Community/U...B-692A451A7AFB

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Maarten" wrote:
thanks,

yes i mean for all variables

for examle
string test = "test" ;

and then fix an eventhandler that starts if the content of the variable
changes.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uR**************@TK2MSFTNGP09.phx.gbl...
Maarten,

Do you mean for any variable? No, you can not. If the instance of

the
type of the variable exposes events, then you can attach to those, but in
general, no, you can not be notified when an arbitrary variable changes.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
might be a stupid question but
can i set an eventhandler for a variable?

regards Maarten



Nov 23 '05 #4
Thanks, just what i needed
regards Maarten

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:B8**********************************@microsof t.com...
You could create a custom object and add event - handling to it. For an
example, see Darth Pedro's "ArrayList with Events" at godotnet.com:

http://www.gotdotnet.com/Community/U...mpleGuid=044E3
F1B-3F23-4849-9F0B-692A451A7AFB
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Maarten" wrote:
thanks,

yes i mean for all variables

for examle
string test = "test" ;

and then fix an eventhandler that starts if the content of the variable
changes.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:uR**************@TK2MSFTNGP09.phx.gbl...
Maarten,

Do you mean for any variable? No, you can not. If the instance of
the
type of the variable exposes events, then you can attach to those, but

in general, no, you can not be notified when an arbitrary variable changes.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
> might be a stupid question but
> can i set an eventhandler for a variable?
>
> regards Maarten
>
>


Nov 23 '05 #5

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

Similar topics

2
by: Sandor Heese | last post by:
Question, When using BeginInvoke (on a From to marshal to the UI thread) with the EventHandler delegate I see some strange behaviour. The problem is that I call the UpdateTextBox method with a...
3
by: Remco | last post by:
Hello, Serverside I'm generating a html page. There are different controls for which I want to create an eventhandler manually. Like: document.forms.TextBox1.onchange = EventHandler;...
0
by: dominosly | last post by:
Okay, this is a rather complicated problem, so here is the short of it: I am using a custom designed user control that simply writes out a plain old html submit button to the page. When the...
12
by: aplaxas | last post by:
Hi! "CDemo.Call" eventHandler is added to "button3.click" Event when both button1 and button2 are clicked. However, I want to add "cd.Call" only one time even though I clicked both button1 and...
5
by: JMWilton | last post by:
Is there a way to determine what has been added to the eventhandler list? I have code that uses += and -= to turn event handling code on and off. Apparently, it is possible to add the same event...
4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
9
by: Christopher Weaver | last post by:
Can anyone tell me how I could iterate through a collection of controls on a form while assigning their event handlers to another identical collection of controls on the same form. So far,...
13
by: jac | last post by:
Hae, I have a windows form with a ComboBox an other things. On that combobox I have an eventhandler on de selectedindexchanged. But somewhere in my code want to do excecute the same code that...
2
by: mawi | last post by:
Hi there, When removing page children controls created dynamically not in last-to-first order, the close button of the last control looses its event wiring, even though the handler is rewired...
2
cornfed
by: cornfed | last post by:
I've got a class to make Templates for different repeaters in my page. in one of these repeaters a linkbutton is needed. This LinkButton needs an event that is in a .cs file somewhere else in the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.