473,657 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2971
"Jeff Williams" <je************ *******@hardsof t.com.auwrote in message
news:13******** *****@corp.supe rnews.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(str ing strNewText)
{
labelDetails.Te xt = strNewText;
_form2.labelDet ails.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
2596
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 form on the popup window is this:
20
2478
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 the site, and then i have to select the file to upload.. i used sendkeys.. and i worked perfect.. BUT ... the computer must be locked for security ( obviusly ) reazons.. so..i think this probable solutions to unlock the computer and run the...
9
3029
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
1255
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 redirect the messages from WndProc to the other application's window handle. This didn't work, so i am sending the messages to the child windows (depending on their position), with some success), but cannot interact with the menu. I have tried the...
2
7650
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 starts, you type a command it does a command and returns a message. I thought I would be able to consume it in my C# app by using the Process.StandardInput in conjunction with the Process.StartInfo.RedirectStandardOutput. The output works fine and I...
15
2303
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 have read all about delegates, event handlers, Invoke methods etc, however they all seem to have undesribale side effects as I have tried them. The hardest part of the aplication is on exit, well I gues I could just
5
11447
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 like outlook) - meaning that on initialization, I check if there is another process running and if so I exit from the new one. in case the main window is hidden and the user tries to open the application again (from the start menu or desktop...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8606
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6169
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.