Cancel
Showing results for 
Search instead for 
Did you mean: 

How to lauch a Winform dialog from a UI Block Styler dialog?

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

I have a winform dialog with one button on it and another dialog created by Block UI Styler.

 

Now I want to achieve the followings,

  1. When I click the button on the winform dialog, the dialog created by Block UI Styler need to show up.
  2. When I click OK or Cancel button of the dialog created by Block UI Styler, the winform dialog comes back.

Is the above possiblt?

2 REPLIES

Re: How to lauch a Winform dialog from a UI Block Styler dialog?

Genius
Genius

Hi Bruce_Qin,

 

let's say you have 2 classes:

- GUI (your Winform)

- NXDiag (your UI Block Styler dialog)

 

What you can do is using 'show' and 'hide' methods:

 

Class GUI
...
...
void showUIBlockStyler(){
NXDiag myNewDialog = new NXDiag(this);
this.hide();
myNewDialog.show();
}

 Now your Winform will hide and the NXDialog will pop up.

Class NXDiag
...
private GUI myReferenceToWinForm
void NXDiag(GUI myCaller){
myReferenceToWinForm = myCaller
}

public int apply_cb(){
// do something
myReferenceToWinForm.show()
}

In the constructor you have to set a reference to the GUI.

In the method apply_cb you have to do whatever you want to do with your BlockStyler and after

doing that just say 'show' to the GUI.

 

Hope that helps!

 

Bye,

 

Flo 

Highlighted

Re: How to lauch a Winform dialog from a UI Block Styler dialog?

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Thanks a lot,Flo!