473,399 Members | 4,177 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,399 software developers and data experts.

Sending message to another window

I have an application using dial monitors which is used in an aution room.

The auctioneer has a form showing details of the current lot number. As
he changes to the next lot number I need to send a message to a form on
the other monitor to change to picture to this new lot.

Shat is the best way to have a form send a message to another form.

ie Monitor one is showing lot 10 details and the monitor two is showing
the picture of lot 10. The auction moves to the next lot on his screen
(lot 11) and the form on the second monitor now updates with the details
of lot 11.

Regards
Jeff
Apr 25 '07 #1
1 2957
"Jeff Williams" <je*******************@hardsoft.com.auwrote in message
news:13*************@corp.supernews.com...
>I have an application using dial monitors which is used in an aution room.

The auctioneer has a form showing details of the current lot number. As
he changes to the next lot number I need to send a message to a form on
the other monitor to change to picture to this new lot.

Shat is the best way to have a form send a message to another form.

ie Monitor one is showing lot 10 details and the monitor two is showing
the picture of lot 10. The auction moves to the next lot on his screen
(lot 11) and the form on the second monitor now updates with the details
of lot 11.
Are the monitors attached to the same computer? With a single .NET
application showing one .NET form on each monitor?

If so, then the answer is as simple as referencing one form from the other.
For example:

class Form1
{
private Form2 _form2;

public Form1()
{
_form2 = new Form2();
_form2.Show();
}

private void _UpdateText(string strNewText)
{
labelDetails.Text = strNewText;
_form2.labelDetails.Text = strNewText;
}
}

Unless you've done something whacky, both forms should be owned by the same
thread. But if not, you will have to use Invoke() or BeginInvoke() in the
_UpdateText() method shown above. Still, not very hard.

The controls on the form are likely going to be "private" by default. So
you'll need to change the access in the property browser to maket them
public so that the first form can access them. Alternatively, provide a
public method on the second form's class that the first form can call, which
then accesses the private control.

For images, just change the example as necessary to set whatever data you
want on whatever property of the form you want. The primary form could just
figure out what image the slave form needs to show, and set it explicitly,
or the slave form could maintain it's own list of images with the primary
form just calling a method on the slave form that takes some kind of index
as a parameter. The specifics don't matter much; the important thing to
understand is that you can maintain a reference in the primary form to the
slave form and do whatever it is you need to do like that.

If the two monitors are on two different computers, and/or the display for
each monitor is handled by two different processes, then it gets more
complicated. You'll need to use some sort of inter-process communications,
such as remoting or sockets to pass the updates from the primary display to
the slave display.

Pete

Apr 25 '07 #2

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

Similar topics

2
by: Person | last post by:
I have a popup window with a form: The popup window is opened like this: <SCRIPT LANGUAGE=javascript> window.open('primos.html', 'primos', config='height=300, width=400') </SCRIPT> The...
20
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
9
by: Sandy | last post by:
can mfc application, send text data to opened notepad file in desktop?(live transfer of data) . can anybody help
0
by: pigeonrandle | last post by:
Hi, I'm trying to redirect click events from a panel in my application to another applications window such that i 'click' the menu of the other application. I (naively) thought i could just...
2
by: nautonnier | last post by:
Hello, I have a C# app that spawns several processes each containing a console app written by another developer in C++. The console app was written first to be just like a console app: it...
15
by: colin | last post by:
Hi, Im familiar with c,c++ etc, and Ive spent a week trying to write my first app in c# it works reasonably well, but im having difficulty getting to grips with inter thread signalling etc. I...
5
by: uvklein | last post by:
Hi there, I'm writing an application with forms. my main window can be hidden (minimize to a tray icon) like...Microsoft Outlook for example. this application can run only one instance (again...
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
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...
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,...
0
isladogs
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...

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.