Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Prevent automatically fire event in vb6

Posted on 2009-04-01
1
Medium Priority
?
505 Views
Last Modified: 2013-12-26
Hello!
   I have a VB6 program with a CheckBox on a form. I have some code for the click event of the CheckBox.
   When i try to programatically change the value of the CheckBox (checked/unchecked), it automatically fires the click event of the CheckBox, executing the specified code.
   Is there a way to prevent the automatically fired event, or at least to detect when the event was automatically/manually fired?

     Thank you!
0
Comment
Question by:Cristi_E
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 24038258
Hi, Cristi_E.

You can't prevent the event from firing, but you can detect a manual change.  Something like this


'Declare a variable at the top of the module'
Public bolManual As Boolean
 
'In your code before setting the value of the checkbox'
bolManual = True
 
'In the event code'
If bolManual Then
    'Clear the switch'
    bolManual = False
Else
    'Code for whatever is done when the click was not a manual change'
End If

Open in new window

0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Starting up a Project
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question