[SOLVED] form.enabled question

Answered
0
0

Hi,
when I set the property Enabled of a form to false
the form is still resizable, and selectable… this is not good. In desktop application form.enabled = false make the form unselectable and unresizable
How I can do that?
regards
Cristian

  • You must to post comments
Best Answer
0
0

Try this:

protected override void OnEnabledChanged(EventArgs e) {
  if (this.Enabled) {
    this.Eval(@"
        this.getBlocker().unblock();
    ");
  } else {
    this.Eval(@"
      // removes the spinner image
      // can change the color mask using this.getBlocker().setColor('green' or null);
      this.getBlocker().setBackgroundImage(null);

      this.getBlocker().block();
 ");
 }

 base.OnEnabledChanged(e);
}
  • You must to post comments
0
0

Hi Luca,
thank you, your code solved more than my problems

continue in this thread that I put a solution 🙂
https://wisej.com/support/question/showdialog-parent-problem?tab=answers#sabai-questions-8664-add-answer

ciao
Cristian

  • You must to post comments
0
0

No workaround?

  • You must to post comments
0
0

ok I can set as movable=false and fixed the size,
but it is still selectable/focusable

  • You must to post comments
0
0

Hi Cristian,

This looks to be the same behavior as WinForms.  You could try two different things:

  1. Attach event handlers to the Form’s EnabledChanged event and toggle the Form’s Movable property and set MaxSize / MinSize properties
  2. Attach a form with a transparent background, no BorderStyle, and a fixed-size directly on top of the other form.

Solution #1 would be easier, but it’s entirely up to you.

Best,

Levie

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.