Close MessageBox through code

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
bjornidar
Posts: 49
Joined: Thu Nov 17, 2011 2:10 am
Location: Norway
Contact:

Close MessageBox through code

Post by bjornidar »

Hi,

I've done some searching and testing to try and close a messagebox through code - as well as using SendWait({ENTER}), though without any results.

Does anyone have an example/ method to get this working?

I've implemented some WCF to communicate with another .NET application and to keep the host open as long as MessageBox is open, it would be nice to close this box with code.

stuartm
Posts: 61
Joined: Thu Jun 06, 2013 9:21 am

Re: Close MessageBox through code

Post by stuartm »

Hello Sir,

Don't use the Message.Show() dialog box.

1) Create a screen
2) Configure screen. General -> select Popup
3) Add a button. While selected -> close screen

The next is create an event in your script


Globals.Screen2.Closed += (s,ss) => {
MessageBox.Show("I'm closed!");
};

Replace MessageBox with your web service business logic.

Best Regards,
Stuart

bjornidar
Posts: 49
Joined: Thu Nov 17, 2011 2:10 am
Location: Norway
Contact:

Re: Close MessageBox through code

Post by bjornidar »

Hi, and thank's for your answer!

Will this keep the WCF-server allive without "crashing" the iX?
I've tried to keep the WCF-server alive with a while-loop and wait for a spesific reply from the WCF-client and then close the server.
But this only made the iX crash.

Post Reply