EZ CodeLess Form Regions

UCM

Centurion
Joined
Jan 1, 2003
Location
Colorado, usa
Nifty Idea here...EZ CodeLess Form Regeions...Only-4-Steps...

Some of you may already know about this, but I figured Id post it for anyone out there that didnt...

I found this out only recently ( it solves about a half a dozen probs Ive 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 forms "Transparency Key" color to make the background of the control SEE-Thru...This comes in nifty if you want a textbox to display its 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 its background color property is set to the forms "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 form2s background image to the bitmap you just created

Step 4:
Set form2s "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 thats nifty, try setting form2s "FormBorderStyle" property to "None" and run it again!!

There ye goo...

Sweet intit


For more information, consult:

[mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWindowsFormsFormClassTransparencyKeyTopic.htm[/mshelp]


See next post for sample project
 
Last edited by a moderator:

UCM

Centurion
Joined
Jan 1, 2003
Location
Colorado, usa
Zipped Example Here...

Here is the zip file.

[edit]Removed binaries from zip file - divil[/edit]
 

Attachments

  • formregiontransparancy.zip
    23.6 KB · Views: 89
Last edited by a moderator:
Top