whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

36 Visitors Online


 
...obtain a transparent Form without coding (Delphi6)?
Autor: JodeQa
[ Print tip ]  

Tip Rating (23):  
     


{
  this is very simple, actually .. you don't need to coding any single line :)
  practically, you just have to set 3 TForm properties
  1. Color
  2. TransparentColorValue
  3. TransparentColor

  For example, just put 1 TButton on the form, then set the form properties :
  1. Color := clBlue
  2. TransparentColorValue := clBlue
  3. TransparentColor := True

  better set the TForm.BorderStyle to bsNone
  RUN .. you'll see only TButton

  logically, you must set TForm.Color same with TForm.TransparentColorValue

  Next Example, let s create 2 TShape

  +-----------+
  |  clWhite
  |           |
  |     +----------+
  |     |  clBlue  |
  +-----|          |
        |          |
        |          |
        +----------+

  then set the form properties :
  1. Color := clBlue
  2. TransparentColorValue := clBlue
  3. TransparentColor := True

  +-----------+
  |  clWhite
  |           |
  |     +-----+
  |     |
  +-----+

  you can also use Bitmap/picture, but it a litte bit tricky, you need a color picker / eye dropper tool,
  to find out the color value for the color i wish to 'remove'
  i use CorelPhotoPaint EyeDropper tool
  after you find the RGB color value, repeat the steps

  tips : if you don't know how to set the RGB value into your TForm Properties
         double click on the "white space" in TForm.Color / TForm.TransparentColorValue property value
         it will bring you Windows color Picker Dialog,


  then, just RUN your program :)
}


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners