473,406 Members | 2,345 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,406 software developers and data experts.

event handler

Hi, all,

I have form which displays a data set and also a timer to read data every
one minute from a xml source and refresh the form.

The user click on a button on the form and bring up another form also
displays the same data set.

How do I send an event to tell the 2nd form that it also need refresh when
the first form runs the refresh routine?

My thinking is it should use "raise" event to tell the 2nd form that it is
time to refresh to screen.

Any one has done this before? Please help!

Thanks!

Greg

Nov 21 '05 #1
4 1246
Hi Greg,
I am doing something similar.
The way I approached it was to create a Data Access Layer.
When the application is opened, it retrieves data from a Database (DB2) into
a DataSet and then saves it into an XML file. If the Database is unavailable
it retrieves the data from the saved XML file into the DataSet.

The main form references the Data Access Class and uses the DataSet. The
timer on the main form tests the currency ( an hour in my case) of the data
and will call the Data Access Class to update the data.

The main form (Purchase Orders) allows the User to call up the Purchase
Order Details form which uses a different DataTable in the DataSet. Whenever
this form is opened its data is current as the main form has called the Data
Access Class to update all data. Both forms use Data Grids bound to
DataViews based on the Data Tables in the DataSet.

Doug

"Greg Chu" <gr******@wendys.com> wrote in message
news:uD****************@tk2msftngp13.phx.gbl...
Hi, all,

I have form which displays a data set and also a timer to read data every
one minute from a xml source and refresh the form.

The user click on a button on the form and bring up another form also
displays the same data set.

How do I send an event to tell the 2nd form that it also need refresh when
the first form runs the refresh routine?

My thinking is it should use "raise" event to tell the 2nd form that it is
time to refresh to screen.

Any one has done this before? Please help!

Thanks!

Greg

Nov 21 '05 #2
You are saying "load" will refresh the data.
I am asking after "load" the form, I need to get notice from the mainform
that I need to get the dataset again since it has been changed.

"Doug Bell" <dug@bigpond> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi Greg,
I am doing something similar.
The way I approached it was to create a Data Access Layer.
When the application is opened, it retrieves data from a Database (DB2)
into
a DataSet and then saves it into an XML file. If the Database is
unavailable
it retrieves the data from the saved XML file into the DataSet.

The main form references the Data Access Class and uses the DataSet. The
timer on the main form tests the currency ( an hour in my case) of the
data
and will call the Data Access Class to update the data.

The main form (Purchase Orders) allows the User to call up the Purchase
Order Details form which uses a different DataTable in the DataSet.
Whenever
this form is opened its data is current as the main form has called the
Data
Access Class to update all data. Both forms use Data Grids bound to
DataViews based on the Data Tables in the DataSet.

Doug

"Greg Chu" <gr******@wendys.com> wrote in message
news:uD****************@tk2msftngp13.phx.gbl...
Hi, all,

I have form which displays a data set and also a timer to read data every
one minute from a xml source and refresh the form.

The user click on a button on the form and bring up another form also
displays the same data set.

How do I send an event to tell the 2nd form that it also need refresh
when
the first form runs the refresh routine?

My thinking is it should use "raise" event to tell the 2nd form that it
is
time to refresh to screen.

Any one has done this before? Please help!

Thanks!

Greg


Nov 21 '05 #3
Greg, I think I see what you have.

You said that the second form was opened from the first form. I assumed
modally, but are you saying that the first form can be editited while the
second is open, causing the problem of unsynchronised data?
"Greg Chu" <gr******@wendys.com> wrote in message
news:el**************@TK2MSFTNGP14.phx.gbl...
You are saying "load" will refresh the data.
I am asking after "load" the form, I need to get notice from the mainform
that I need to get the dataset again since it has been changed.

"Doug Bell" <dug@bigpond> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi Greg,
I am doing something similar.
The way I approached it was to create a Data Access Layer.
When the application is opened, it retrieves data from a Database (DB2)
into
a DataSet and then saves it into an XML file. If the Database is
unavailable
it retrieves the data from the saved XML file into the DataSet.

The main form references the Data Access Class and uses the DataSet. The
timer on the main form tests the currency ( an hour in my case) of the
data
and will call the Data Access Class to update the data.

The main form (Purchase Orders) allows the User to call up the Purchase
Order Details form which uses a different DataTable in the DataSet.
Whenever
this form is opened its data is current as the main form has called the
Data
Access Class to update all data. Both forms use Data Grids bound to
DataViews based on the Data Tables in the DataSet.

Doug

"Greg Chu" <gr******@wendys.com> wrote in message
news:uD****************@tk2msftngp13.phx.gbl...
Hi, all,

I have form which displays a data set and also a timer to read data every one minute from a xml source and refresh the form.

The user click on a button on the form and bring up another form also
displays the same data set.

How do I send an event to tell the 2nd form that it also need refresh
when
the first form runs the refresh routine?

My thinking is it should use "raise" event to tell the 2nd form that it
is
time to refresh to screen.

Any one has done this before? Please help!

Thanks!

Greg



Nov 21 '05 #4
Greg,

It goes exactly as you tell, therefore you have to create a public event in
form 2
raise that events in form 2 when happens what you tell
declare your form2 Friend withevents in form1
create your form2 using the declaration
and than catch that event the same as with a textbox or whatever.

Simple I thought?

Cor
Nov 21 '05 #5

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

Similar topics

10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
6
by: vbMark | last post by:
If I have a control, for example a CheckedListBox, how do I add and event to code, for example that a box has been checked by the user? Thanks
13
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
3
by: Beth | last post by:
in the following: this.ExitButton.Click += new System.EventHandler(this.ExitButton_Click); if I saw an equation, such as y +=x; then y = y+x. But what is the meaning in the event handler. I...
5
by: Richard Grant | last post by:
Hi, I need to "save" in a variable the event handler sub of a control's event, then perform some process, and finally "restore" the originally saved event handler. Example in pseudo-code: 1)...
1
by: tdan | last post by:
I do not know how to get Event.stopObserving() to work in the context I am using it. I am displaying a Color Selection Table and attaching 2 events: 1. onmouseover to display the color to the user...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
2
by: =?Utf-8?B?UlJK?= | last post by:
Hello, I would like to add the Paint handler to the form. How to do it? Thanks in advance.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
agi2029
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 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.