Solved

How to send button down to  a button of another WPF C# application

Posted on 2011-03-17
6
388 Views
Last Modified: 2013-12-17
I wrote an WPF C# application (called slave application)  that have a button. When click on it, it will perform a task.
Now I launch 10 copies of this slave application.
I will like to be able to create another C# application (called master application) with a buttton. When click on this button in the master application , it will as if I have manually clicked on each of the button of the 10 copies of the slave application.

Did anyone have any idea how I can achieve that?
0
Comment
Question by:tommym121
6 Comments
 
LVL 7

Expert Comment

by:nbove
ID: 35161308
1)  Ensure that the method responsible for handling the button click in the "Slave" application is marked as public.

2) In the event handler of the button click in the "Master" application, iterate over each "Slave" application instance and call the method responsible for handling the button click.
0
 

Author Comment

by:tommym121
ID: 35161703
Any code example to show how this to be done.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 400 total points
ID: 35371698
I would suggest something more along the lines of IPC (Interprocess Communication).  You could use a TCP/IP socket, .NET remoting, or a named pipe.

Simple Inter-Process Communication In VB.Net
http://anoriginalidea.wordpress.com/2007/08/09/simple-inter-process-communication-in-vbnet/

.NET 3.5 Adds Named Pipes Support
http://www.switchonthecode.com/tutorials/dotnet-35-adds-named-pipes-support

Socket Send and Receive [C#]
http://www.csharp-examples.net/socket-send-receive/
0
 
LVL 25

Assisted Solution

by:apeter
apeter earned 100 total points
ID: 35376387
If slave and master application are in the same system and named pipe is the best choice.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now