42336members
215701posts

Hide or Remove the form close button "X"

Highlighted
Crewman

Hide or Remove the form close button "X"

Hi. Perhaps has somebody a good idea how I can remove or hide the popup close button. This popup was created with the VBscrpt language with the commands "Form.Init()" ... "Form.Show()" I can't find in the help or in the web a solution how I can remove "X". It exists also not form property for hide or an event which occur when I click on "X"

Popup Window.JPG

6 REPLIES 6
Highlighted
Commander

Re: Hide or Remove the form close button "X"

Unfortunately I don't think this is possible.

This is a VBscript form, so is outside the control of ViewX/ClearSCADA.

 

There's not really a way that I can think of to hack something similar either.  You could always handle the form closing using the 'X' (since the .Show() result will be empty) and re-display the form again.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Highlighted
Crewman

Re: Hide or Remove the form close button "X"

Thanks for the quick answer!! The problem is when the form opens then there is a variable in the database which is set to 1. If I push the "Cancel" button then the VBscript set this variable to 0. But if I push "X" then there is no chance to modify the variable. It's very pitty.

Commander

Re: Hide or Remove the form close button "X"

When the 'X' is pressed, control is still returned to your VBscript.

 

So you could have your VBscript detect this condition and do the most appropriate thing.

If that's to set your variable to 0, then you could do that, or you could redisplay the form if you really need to try to get them to enter correct values (although this obviously isn't bullet proof, if the user closes ViewX you don't get any valid entry).

 

 


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Highlighted
Crewman

Re: Hide or Remove the form close button "X"

Hey Bevan,

 

to your last answer:

When the 'X' is pressed, control is still returned to your VBscript.

 

That's not so. Unfortunately when the "X" was pressed the VBscript execution stopps. There is no part in the script which is after "X" continued.

Highlighted
Commander

Re: Hide or Remove the form close button "X"

Here's some code... run it

 

Form.Init("Test Form")
Form.AddStaticText 10, 10, "Here's a form"
Form.Show()
MsgBox "We definitely returned afterwards"

 

Now if you click the 'X' and the MsgBox appears then you are wrong.

That means that after pressing the 'X' the control flow does indeed return to your (my) code.

 

Problem solved.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Highlighted
Crewman

Re: Hide or Remove the form close button "X"

Hi Bevan,

 

thank you very much. I'm so happy that it works. My problem was that I have realy long vb scripts and up to day I didn't know that the script continue after form.show(). Also my colleagues doesn't know this. I'll inform them.

Thanks a lot!!!!!!

 

Best regards

Alois