Disable the cross button on a Fix Inspect Form

patcccc

Member
Hi...

Can anyone tell me if it is possible to disable the cross button (Used to close the form) on a fix inspect form?

Or may be if it can be hidden?

Thanks for your help
 
Hi patcccc,

Unfortunately you can not hide or disable the cross button on a Fix/Inspect form as well as on all other form type, except Message form.

What is your goal to do that?
Do you want to force the user go ahead with OK button?
If you describe your issue a bit detailed, maybe we can give you some work around to solve your issue.

(e.g. to use Message form instead of Fix/Inspect or calling the form in a cycle while user try to leave the form with Cancel/Cross button, etc.)

Regards,

Zoltán
 
I want to prevent the user from cancelling the form.
Clicking on the OK Button is compulsory.

I was just looking for a simpler solution :-(
Anyway I have the work around to this problem. I will check if the system goes through the post Ok button Clicked. If No.. an error will be displayed.

Thanks
 
Hi patcccc,

Q1.) Does your Fix/Inspect form data entry field?
Q2.) If Q1=Yes, then are these entry field database table related?

Regards,

Zoltán
 
Hi patcccc,

Here are two cents for you:

1.) Add all data entry field to the form interconnect DSTR of the form.
2.) Add a cFormCanceled_EV01 flag to the form interconnect DSTR of the form.
3.) Create Variables for all data entry field to store their values, where you call the form.
4.) Create a variable cFormCanceled_EV01, to catch return value.
5.) Initialize these variables accordingly your task.
6.) Call the form in a "While cFormCanceled_EV01 is equal to '1'" loop.
7.) Pass the variables for data entry fields as Input/Output parameteres, cFormCanceled_EV01 as output.
8.) In the Post Button clicked event of OK/Cancel assign value '0' and '1' to cFormCanceled_EV01 accordingly, further populate form interconnect aparameters from the data entry fields.
9.) In the called form, at initialization set the data entry fields from interconnect parameters if they do not populated automatically.

If my memory serves me well, Cancel button events are executed when you hit the cross button.

Please, let me know your results if you tried this "silly" solution.

Regards,

Zoltán
 
Why can't you use system function "Disable Control" in Event Rules . I tried this in "Post Dialog is Initialized " and it seemed to work . Did I miss something ? :confused:
 
Just in case the user closes the window instead of clicking "Ok" , in "End Dialog " include code to "Press Button (&HC Ok) " .
 
Thanks Zoltan...Your solution is working fine.

I see that Jdepeople said in one of his replies that he has been able to disable the cross button (found at the right top corner) on a form. Can you please give me more info about which control did you use?

I also tried the press Ok button on End Dialog but still the form is closed. (I want it to remain open as until all mandatory fields are populated)
 
Pat,
What I meant was disable the "Cancel " button and force the user to click "Ok" or close the form . I missed the "mandatory fields should be populated" part . Sorry .
 
This is what you seem to want. Note that this will only work on PC based clients, not the HTML client.

Create a new BSFN and map it to run on the client box (not server). This should still work fine on citrix, but test it out. The data structure to the bsfn can be anything since we're not using any passed values. The following will turn off the X close button on the menu bar.

HMENU hmenu;
HWND parentHWND;
/************************************************************************
* Check for NULL pointers
************************************************************************/
if ((lpBhvrCom == blah blah blah {
blah blah
}

/************************************************************************
* Main Processing
************************************************************************/
/* disable the X close box */

parentHWND= GetParent(lpBhvrCom->hDlg);
hmenu = GetSystemMenu(parentHWND,0);
EnableMenuItem(hmenu,SC_CLOSE,MF_BYCOMMAND | MF_DISABLED);
DrawMenuBar(parentHWND );

return (ER_SUCCESS);


Now just call this BSFN in the forms Init Section. Voila, the X is grayed out and can't be pressed.

GOOD LUCK!
 
Back
Top