Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Show dialog
PostPosted: Thu Jul 23, 2015 11:59 pm 

Joined: Sun May 31, 2015 2:38 am
Posts: 14

Offline
Hello

Anyone know if it is possible to to show a screen as a dialog instead of new screen? Like with the windows form class .ShowDialog? Also, if it is possible, how to set Dialog Result for buttons?


 Profile  
 
 Post subject: Re: Show dialog
PostPosted: Wed Jul 29, 2015 6:30 am 

Joined: Fri Jan 27, 2012 4:20 am
Posts: 161

Offline
Can You clarify, what is the "discussion" with HMI about? Simple, which screen to open, or something else?


 Profile  
 
 Post subject: Re: Show dialog
PostPosted: Thu Jul 30, 2015 1:15 pm 

Joined: Mon Jun 11, 2012 2:10 pm
Posts: 89

Offline
To make a screen be a dialog instead of a window, under the General properties ribbon, select Popup and Modal (to have window just be like tool window, do not select Modal).

To pass Dialog results you can use a tag or something like
Code:
result = ((System.Windows.Forms.Form)(Globals.ScreenName)).ShowDialog();
I will note, I've never tried to show a screen by directly using ShowDialog so I'm not 100% sure what to expect.

To get a button to return a dialog result of OK, add the following code to the button's click event
Code:
DialogResult = DialogResult.OK;
This will also close the dialog window.

_________________
Adam M.
Controls Engineer
FlexEnergy


 Profile  
 
 Post subject: Re: Show dialog
PostPosted: Fri Jul 31, 2015 10:31 am 

Joined: Sun May 31, 2015 2:38 am
Posts: 14

Offline
AMitchneck, I've tried your solution, but it ends up with a conversion fault when casting the object ScreenWindowsAdapter to a Forms.Form object.


 Profile  
 
 Post subject: Re: Show dialog
PostPosted: Tue Aug 04, 2015 6:57 am 

Joined: Mon Jun 11, 2012 2:10 pm
Posts: 89

Offline
Claus,

As I mentioned, I've never tried to call the ShowDialog method directly. What I do is set the dialog screen general settings to popup and modal. This makes the iX's show function work like the ShowDialog function, but without the result. To pass a result, I set a tag within the dialog.

_________________
Adam M.
Controls Engineer
FlexEnergy


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: