Главная страница | назад

Article #23148: How do I prevent the user from interacting with a control (e.g Form)?

Question:  I want a form to be shown in order to display data and controls, but I also want to prevent the user from interacting with it until a certain time.  How do I do this?

Answer:  By setting the Enable Property of the control to false.

If the Enabled property of a control is false, it will ignore mouse, keyboard, and timer events.  Now, if Enabled is set to false on a form, all controls that appear on the form will also be effectively gaurded against user interaction.  When you wish to allow user interaction with the control, merely set Enabled to true.

Last Modified: 25-NOV-00