473,385 Members | 1,769 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,385 software developers and data experts.

Last event

When Form is invoked with
myForm.Show
what is the last event of the form object?
I have some code in TextChanged events of many TextBoxes and other controls
populated with data from datatable via BindingSourse. I want to set the flag
blnDataChanged = True only when data changed by the user, not when data in
controls is changed by initial populating. I think the flag should be set to
false after all events of the form have been fired. But I tried Activated,
Shown and some others and all the time the flag is set to true after initial
load of the form

Thanks
Esha

Sep 13 '06 #1
5 1450
Esha,

Than take care that all intitialisation is done before the events are set.

This depends really how to do on the language you are using and than it is
even better to ask this in a language group because of that.

Have a look at the newsgroups
microsoft.public.dotnet.languages.vb (or csharp or vs)
or
microsoft.public.dotnet.jsharp

I hope you find your solution soon,

Cor

"esha" <es**@newsgroups.comschreef in bericht
news:ux****************@TK2MSFTNGP05.phx.gbl...
When Form is invoked with
myForm.Show
what is the last event of the form object?
I have some code in TextChanged events of many TextBoxes and other
controls populated with data from datatable via BindingSourse. I want to
set the flag blnDataChanged = True only when data changed by the user, not
when data in controls is changed by initial populating. I think the flag
should be set to false after all events of the form have been fired. But I
tried Activated, Shown and some others and all the time the flag is set to
true after initial load of the form

Thanks
Esha

Sep 13 '06 #2

esha wrote:
When Form is invoked with
myForm.Show
what is the last event of the form object?
I have some code in TextChanged events of many TextBoxes and other controls
populated with data from datatable via BindingSourse. I want to set the flag
blnDataChanged = True only when data changed by the user, not when data in
controls is changed by initial populating. I think the flag should be set to
false after all events of the form have been fired. But I tried Activated,
Shown and some others and all the time the flag is set to true after initial
load of the form

Thanks
Esha
Then do it in the form's constructor. Create a bool and set it to true
in the constructor. Then inside the TextChanged events for your
textboxes, check that bool. If it is true, then just exit the
TextChanged event. Then, in the OnShown event or at the end of the
Load event, set the bool to false to indicate that loading is done.

Sep 13 '06 #3
Thank you.
I tried your scenario and set bool to false on both - at the end of Load and
in Shown. In both cases TextChanged event fired before and after. When it
fired before it was not doing anything, but after I set bool to false it did
what I did not want to.
So I'm still looking for the form event which is fired last.
"Chris Dunaway" <du******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
esha wrote:
>When Form is invoked with
myForm.Show
what is the last event of the form object?
I have some code in TextChanged events of many TextBoxes and other
controls
populated with data from datatable via BindingSourse. I want to set the
flag
blnDataChanged = True only when data changed by the user, not when data
in
controls is changed by initial populating. I think the flag should be set
to
false after all events of the form have been fired. But I tried
Activated,
Shown and some others and all the time the flag is set to true after
initial
load of the form

Thanks
Esha

Then do it in the form's constructor. Create a bool and set it to true
in the constructor. Then inside the TextChanged events for your
textboxes, check that bool. If it is true, then just exit the
TextChanged event. Then, in the OnShown event or at the end of the
Load event, set the bool to false to indicate that loading is done.

Sep 13 '06 #4
Esha,

My problem is that I cannot find it any more, I thought that Kevin, Peter or
one of their collegues has showed this in a nice reply in the VB.Net
language newsgroup.

There are two sequences depending on what you are doing I thought that had
to do with closing or not closing, but those I do not remember me at the
moment.

I have tried to find this on MSDN, but most probably because of the new
search engine I am not able to find that anymore in a reasonable time (there
are some nice articles about this on MSDN).

Maybe you can try it yourself.

Cor

"esha" <es**@newsgroups.comschreef in bericht
news:uI**************@TK2MSFTNGP04.phx.gbl...
Thank you.
I tried your scenario and set bool to false on both - at the end of Load
and in Shown. In both cases TextChanged event fired before and after. When
it fired before it was not doing anything, but after I set bool to false
it did what I did not want to.
So I'm still looking for the form event which is fired last.
"Chris Dunaway" <du******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>>
esha wrote:
>>When Form is invoked with
myForm.Show
what is the last event of the form object?
I have some code in TextChanged events of many TextBoxes and other
controls
populated with data from datatable via BindingSourse. I want to set the
flag
blnDataChanged = True only when data changed by the user, not when data
in
controls is changed by initial populating. I think the flag should be
set to
false after all events of the form have been fired. But I tried
Activated,
Shown and some others and all the time the flag is set to true after
initial
load of the form

Thanks
Esha

Then do it in the form's constructor. Create a bool and set it to true
in the constructor. Then inside the TextChanged events for your
textboxes, check that bool. If it is true, then just exit the
TextChanged event. Then, in the OnShown event or at the end of the
Load event, set the bool to false to indicate that loading is done.


Sep 14 '06 #5
esha wrote:
Thank you.
I tried your scenario and set bool to false on both - at the end of Load and
in Shown. In both cases TextChanged event fired before and after. When it
fired before it was not doing anything, but after I set bool to false it did
what I did not want to.
So I'm still looking for the form event which is fired last.
At the beginning of the constructor, you set it to *true*. Then inside
the Text_Changed event you check the value of the variable. If it is
true, you simply exit the method and don't execute the code. The
TextChanged event will still fire, but the code inside it will not be
executed. Then at the end of FormShown, you set that variable to false
so that the TextChanged event code will execute normally.

I think FormShown might be the last event but I'm not sure.

Sep 14 '06 #6

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

Similar topics

0
by: pyuk2005 | last post by:
The UK Python Conference for 2005 will take place at the Randolph Hotel, Oxford on 20-23 April 2005. This is the FINAL CALL for talks. The original deadline of 26th December has been extended...
12
by: francisds | last post by:
Hi, Can you guys see if there's a solution to this problem? I have a database from which I have to read each record and process that record. New records are being added all the time, so I...
1
by: sixsoccer | last post by:
I have built a database with a <Mainform> and a <Subform>. My problem is twofold. 1. My subform is set as a continuos form with AllowAddiotions set to NO (ie. a list of Issues to the client on...
3
by: BLUE WATER | last post by:
Hi, I have managed to simplify my problem but can't seem to get this to work. I want to open up a form from a click event of another form, but not only open the form when the button is pressed...
3
by: Ryan Liu | last post by:
Hi there, I got a NullReferenceException when delete last row in a datagrid. I had hard time to solve since it does not occur in my own code. I put a datagrid in my inherited user control,...
4
by: Sameh Ahmed | last post by:
Hello there Is there a way to get the last control that was in focus before the current control? please note that I don't want the next or previous control in the tab order, I need the last one...
5
by: Nathan Sokalski | last post by:
I have a control that I want displayed in all items except the last one. I figured the best way to do this was to determine whether the current item was the last from within the ItemDataBound event...
3
by: MarcJoseph | last post by:
I have a database that is shared my multiple users who enter and update records on a weekly basis. Is there a way I can add a field to my main data table that will automatically generate the...
2
by: John Kotuby | last post by:
Hi all, Thanks in advance for any suggestions... I am using a repeater to display the contents of a DataTable which is bound to it. All the rows in the table are being displayed. In the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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 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.