UCM Posted January 11, 2003 Posted January 11, 2003 (edited) Nifty Idea here...EZ CodeLess Form Regeions...Only-4-Steps... Some of you may already know about this, but I figured I'd post it for anyone out there that didn't... I found this out only recently ( it solves about a half a dozen probs I've had in previous projects as well )... You can make a form region transparent with SEE-Thru ( you can have controls on the form and set their backcolor property to the form's "Transparency Key" color to make the background of the control SEE-Thru...This comes in nifty if you want a textbox to display it's contents and blinking cursor on top of the entire screen ;-) ) First off, every form has a property "Transparency Key"...At form creation, this property is by default blank...You can set the color to whatever color you want to be transparent at run time...This transparent color will make the background of any control on this form transparent as long as it's background color property is set to the form's "Transparency Key"... Plus!! If you specify a background image for the form then everywhere in that image where this "Transparency Key" color is, the form will make it transparent...No more fooling around with regions for me ;-) Step 1: Create a background image for your form ( I used paint and made the background of my bitmap the color I wanted .NET to recognize as transparent...Then I created a box and an oval and filled their inside area with the same color I picked for the background of the bitmap so that it would also be transparent ) Step 2: Use Visual Studio and add a new form, form2... Step 3: Set form2's background image to the bitmap you just created Step 4: Set form2's "Transparency Key" property to the color you chose in your bitmap to be the transparent color Now Run It with form2 Active!!!! ;-) If you think that's nifty, try setting form2's "FormBorderStyle" property to "None" and run it again!! There ye goo... Sweet int'it For more information, consult: [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWindowsFormsFormClassTransparencyKeyTopic.htm[/mshelp] See next post for sample project Edited January 11, 2003 by Robby Quote UCM >-)
UCM Posted January 11, 2003 Author Posted January 11, 2003 (edited) Zipped Example Here... Here is the zip file. [edit]Removed binaries from zip file - divil[/edit]formregiontransparancy.zip Edited January 11, 2003 by divil Quote UCM >-)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.