I was wondering if there are any gotchas for making a form completely transparent (as opposed to hiding it). For instance, I know that these are things that got my by surprise when hiding a form:
- If a form is hidden, you cannot interact with its controls (can’t add HTML to a webbrowser control, can’t push a button, etc.)
- Changing the WindowState (minimized, maximized, etc) of a window while it is hidden will cause the window to appear outside the scope of your work area when the form is shown again.
Has anybody run into similar problems (or completely different ones!) while using a form with opacity set to 0 (completely transparent)?
From the up votes for my comment, I guess I’ll submit it as an answer. I would discourage using
Form.Opacity = 0. Even though you can disable the form to prevent accidental interaction, I would think the transparent form would overlay other windows and confuse the user as to why he can’t interact with windows behind your transparent one.As for the gotcha’s for
Form.Hide(), I typically queue form responses so that when the form returns into view (or visibility), it goes through the queue to process actions (i.e. changing FormState). Changing the form while it’s hidden can also really confuse the user.