Transparrency

hi!
i was wondering how to make a textbox/Listbox Transparrent
how do i make this possible?

stian
LVL 2
joepeztAsked:
Who is Participating?
 
mrcalabConnect With a Mentor Commented:
That's not so difficult, the only things you have to do are the following ones:
Set Textbox.canvas.brush.style to bsClear to make it background-less.

Then create a modified version of the TTextbox as following:

in interface part:

TNewTextBox = class(TTextbox)
private
procedure paint; override;
end;

in implementation-part:

Procedure TNewTextBox.Paint;
Begin
   bitblt(canvas.handle,0,0,clientwidth,clientheight,thebitmap.canvas.handle,0,0,srcCopy);
inherited paint;
End;

But you need in any case a canvas to be able to paint a picture in the background.
0
 
edeyCommented:
What kind of "transparent" attributes do you want?  This can be difficult, depending upon exactly how you want the control to operate.



GL
Mike
0
 
joepeztAuthor Commented:
i just want to eliminate the background color, so i can have a Timage in the background

please send a reply to my mail adress, stian@nano.no, im leaving home now :)

i get the mail on my cellphone..

stian
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
edeyCommented:
Should mention a couple of alt.'s:

-setting the control's canvas.bruh.style to bsClear will cause the control to be "clear", though it won't update properly

-setting the control's windowRGN allows for non-rectangular controls.  If the content doesn't change much you can for the edge of the control around the content.  Thing is, the "transparent" parts aren't really transparent, they just aren't there at all.

-The PaintDesktop function fills the clipping region in the specified device context with the desktop pattern or wallpaper.

-Create on owner draw control & copy whatever you think should be under the control on top of it.

GL
Mike
0
 
joepeztAuthor Commented:
ok... i'll try this...

though bsClear wont clear anything.. it just marks the entire string...

could you explain hos to use the brush thing and the ownerdraw ?

stian.. thanx for the help :-)
0
 
edeyCommented:
that's pretty much it


GL
Mike
0
 
joepeztAuthor Commented:
hmm.. i was using a edit box, and it says paint is not defined in the Base Class...

where do i earn points?

stian

0
All Courses

From novice to tech pro — start learning today.