Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Second question first: Setting <code>Visible := False</code> is of no benefit because the point of all ShowXXX methods is to make the form visible. As David says, you could perform the actions without calling Show at all, provided of course your form doesn't rely on any <code>OnActivate</code> or <code>OnShow</code> code in order to do it's job properly.</p> <p>As for whether this is a good idea, I say <strong>no</strong>!</p> <ul> <li>As I've already pointed out there is a concern you have to watch out for. I.e. that currently (or even due to maintenance at some point in the future) your form relies on being visible to do its job properly.</li> <li>Of course, you could work around that by letting the form flicker open, and be programatically closed. Clearly an aesthetically poor choice.</li> <li>Not to mention the problems of getting it right. You'll end up writing a bunch of patch-work code to wrap the form so that it can do what you need to do, when you should rather do the following...</li> </ul> <p><strong>Correct Approach</strong></p> <ul> <li>Your form is currently doing at least 2 distinct things: <ul> <li>Visual UI control (call it A)</li> <li>and "mandatory functionalities" (call it B)</li> </ul></li> <li>It doesn't matter much whether B is doing validation rules, extra processing, or whatever.</li> <li>B is a process that does not require user interaction.</li> <li>Therefore, you need to: <ul> <li>Copy B into a non-UI location (either a simple unit with a custom object or a data module). Call it B*</li> <li>Modify the form to call B* instead of using B.</li> <li>Test that your form still behaves correctly.</li> <li>Delete B</li> <li>And now you can have your new form call B* instead.</li> </ul></li> </ul> <p>The above approach will save you huge headaches in the future.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload