Problem Source: http://www.cnblogs.com/del/archive/2009/12/22/1629717.html#2096734
1. Use transparentcolor and transparentcolorvalue to specify a transparent color for the form;
2. Draw non-transparent text and use tlabel to present the text;
3. process the wm_nchittest message so that the form can be dragged;
4. Use the ESC key to exit.
Test Code :
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls, extctrls; Type tform1 = Class (tform) timer1: ttimer; procedure formcreate (Sender: tobject); Procedure submit (Sender: tobject); Procedure formkeypress (Sender: tobject; var key: Char); private protected procedure publish (VAR message: twmnchittest ); message wm_nchittest; public end; var form1: tform1; implementation {$ R *. DFM} procedure tform1.formcreate (Sender: tobject); begin formstyle: = fsstayontop; borderstyle: = bsnone; transparentcolor: = true; transparentcolorvalue: = color; font. size: = 72; font. name: = 'arial black'; // doublebuffered: = true; end; Procedure tform1.formkeypress (Sender: tobject; var key: Char); begin if key = CHR (27) then close; end; Procedure tform1.timer1timer (Sender: tobject); var STR: string; begin STR: = timetostr (now); clientwidth: = canvas. textwidth (STR); clientheight: = canvas. textheight (STR); canvas. lock; canvas. brush. color: = color; canvas. fillrect (clientrect); canvas. brush. style: = bsclear; canvas. font. color: = clblack; canvas. textout (1, 1, STR); canvas. font. color: = clred; canvas. textout (0, 0, STR); canvas. brush. style: = bssolid; canvas. unlock; end; Procedure tform1.wmnchittest (VAR message: twmnchittest); Begin message. result: = htcaption; end.