Hi all,
Why Control_Change() event is fired before Form_Load()?
NE☼
9 1097
Why Control_Change() event is fired before Form_Load()?
I don't think it is.
In any case, which version of VB are you referring to?
Ofcourse it should not, as I believe too. I'm using VB6.
I saw it by using "step into" (F8) from Debug menu.
I think my Console is to be repaired.
NE☼
What sort of control is it? Perhaps it is firing an event when it shouldn't (assuming that's possible).
Hi all,
Why Control_Change() event is fired before Form_Load()?
NE☼
this appears only when u try changing some properties of form's controls before using .Show method.
Example:
Form1 Code -
Private Sub Command1_Click()
-
'yours calculate here
-
result = calculate(smthing)
-
Form2.Text1.Text = result
-
Form2.Show
-
End Sub
-
Here, i calculated some value in form1 and pass it through form2. If u do so, either, u will sometime see Form2 load twice. One before Text1_Change() and one after.
...Here, i calculated some value in form1 and pass it through form2. If u do so, either, u will sometime see Form2 load twice. One before Text1_Change() and one after.
That's interesting. Even if you do this, it should only load the form once, unless you unload it in between. As soon as you access the contents of the form (Form2.Text1.Text in this case) the form must first be loaded. It should not then be loaded again when you show it, merely made visible.
In theory, that is.
A quick test verifies this. As soon as you access a property of the control (text property of a textbox in my test) the form is loaded, then the control's change event fires. Then when you Show the form, neither event fires. As expected.
Yeah, quick test verifies as expected. This is why i'm surprised why it's showing behavior which is unexpected.
Surely there is a reason behind it means I'm using/doing something which made textbox_change event to be fired before form load.
I am doing simple tax, amount calculations in form and no form properties are being accessed (atleast in change events)
I will surely find and tell you the reason soon. Any comment/Idea is welcome.
NE☼
Hi all,
Why Control_Change() event is fired before Form_Load()?
NE☼
i think this may happen -
Private sub control_Change()
-
Control.text = ”Changed”
-
End sub
-
-
Private sub Form_Load()
-
Control.text = ”Do not Chang”
-
End sub
Then output will be :
Control.text = ”Changed”
i think this may happen...
Possibly, but I think neo008 indicated that stepping through the code showed the sequence in which they fired.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: theintrepidfox |
last post by:
Dear Group
Just wondered whether you have any advice on the following?
I have a form with a TabControl and when the form loads, the
SelectedIndexChanged event is fired. Is there any chance to...
|
by: Michael Cleroux |
last post by:
Hi there,
I read this in the Access 2002 help file:
'The class that raises an event is the event source, and the classes that
implement the event are the sinks. An event source can have...
|
by: Rich |
last post by:
Hi everyone,
I have run into a quandry here. Here is a simplified scenario that
mirrors my real problem.
I have a page that has 2 buttons:
On page load, the page runs some complex...
|
by: C M Shaw |
last post by:
I have a form which I want to show modally; it's a fairly old form
that's been ported up several versions of VB, and I'd like to keep its
rewriting to a minimum. Basically, it is used in this...
|
by: JohnR |
last post by:
In it's simplest form, assume that I have created a usercontrol,
WSToolBarButton that contains a button. I would like to eventually create
copies of WSToolBarButton dynamically at run time based...
|
by: garyusenet |
last post by:
I was originally taught to double click the form, to get to the load
event handler and in there put anything I want to happen when my form
is opened.
However, today whilst reorganising some code...
|
by: alexia.bee |
last post by:
Hi All,
I have window based app which has two classes.
Class A and Clas B
Call B Inherits from Class A.
Class A has events. How do I cause Class B not to use Class A events.
For example:...
|
by: Hamed |
last post by:
Hello
I have a Data Entry Form having some controls including a TextBox. When the
user types an entry, I query a table and if it was entered before, I ask the
user (using ShowModal method of a...
|
by: =?Utf-8?B?VG9u?= |
last post by:
Hello,
I want to understand teh benefits of ajax technology. Does anyone has a good
website where AJAX EXTENSIONS is worked out so I really understand it.
There a 2 main questions:
1) How about...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
|
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...
| |