Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2008, 04:11 PM
Authorized User
 
Join Date: Aug 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tusharkale
Default Detect Variable change in C#

Is there any way by which I can detect a variable change in C#. In VB we have WithEvents..how do I do this in C#??

I want to detexct variable change n then do something.


Thanks

 
Old July 8th, 2008, 02:14 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You don't need to declare it "withevents" in C#, "WithEvents" in VB means that you are notified of the object's events. Just declare a variable and instantiate the object. Then add an event handler. See http://msdn.microsoft.com/en-us/library/aa645739(VS.71).aspx on "Hooking up to an event".

--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
change value of code behind variable via Java Scri dhumplopoka Javascript 0 October 20th, 2008 10:35 AM
How to change ASP variable in VBScript jimusa Classic ASP Basics 1 August 13th, 2008 07:08 PM
Change php Variable with javascript manih Pro PHP 1 October 27th, 2006 09:43 AM
Detect Change jking SQL Language 2 May 27th, 2005 05:57 PM
Change session variable definitions NickOg Javascript How-To 2 October 29th, 2004 03:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.