Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1448

Make a modal form wich is modal by software, no with modal show

$
0
0
I post the code in a thread to resolve a problem, but i think this code must be here.

We have a Form1 like a dialog and we wish to open a "modal" form Form2 and maybe a help form Form3 which maybe stay open while Form2 closed.
Also we don't like to disable Form1 controls. So how we can shield Form1 from clicks?

The answer is by using a form as shield in front of Form1. This shield turned transparent so nobody knows that exist. If we click on form1 in taskbar then we send focus to this transparent Form, but our "modal" Form2 and perhaps if visible Form3 are both always in front of this transparent form. So we did nothing if we click on Form1 (which is covered with shield form). When Form2 close, turn transparency of shield form to 0, so we can use Form1 without unload shield, because shield is like no exist any more (but is loaded and in show state, so can hold other forms).
If we wish we can turn transparensy to an ammound of 50 so to dimm Form1, the way we see in Html forms when modal windows popup.
Attached Files

Viewing all articles
Browse latest Browse all 1448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>