Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 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 December 6th, 2006, 01:00 AM
Registered User
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default C# 2005 Application.EnableEvents


I have a textbox, in my project, I already wrote some functionality which execute during textbox value change in the textbox_valuechange event.

When I try to assign some value to the textbox this textbox_valuechange event is firing.

My problem is I need to prevent this, In VBA I found one Event Application.EnableEvents = false, which usually present events associated with that control and again when we make it as Application.EnableEvents = true, then event firing for control begin to execute like:

VBA Code:
Application.EnableEvents = false
txtText1.value = "Dotnet"
Application.EnableEvents = true

There is any events or method in C#2005, which is equivalent to VBA Application.EnableEvents exists?..

Can anybody help me!.


Old December 6th, 2006, 02:35 AM
Registered User
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to MadJac

you simply need to create your own flag at the top of your class.

bool flag = true;

in some function

change_text(string text)
flag = false;
textbox.text = text;
flag = true;

if(flag == true)
     do this, and if the flag is false ten it won't do anything.

thats the simplest idea i can come up with, and not 100% sure it'll work. you can try it anyway

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB 2005 Application vs. Access Database dirtdog22 Visual Basic 2005 Basics 1 April 19th, 2008 08:27 AM
[Resolved] [2005] Call Outlook in vb application snufse .NET Framework 2.0 1 February 12th, 2008 04:58 PM
Migrating 2005 AJAX-Enabled Web Site to 2005 SP1 jrblack10 ASP.NET 2.0 Professional 0 July 25th, 2007 02:16 PM
Tutor needed for VB 2005 application edx VB How-To 9 May 13th, 2007 04:26 PM
Migrate application VS 2003 to VS 2005 rishi123 .NET Framework 1.x 0 December 28th, 2006 07:13 AM

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