Note that there are some explanatory texts on larger screens.

plurals
  1. POVCL component Opacity/transparence
    primarykey
    data
    text
    <p>Is it possible to make e.g 20% transparent TMemo or other vcl component? like TButton or TEdit?</p> <p>While googling for solution I've found this: </p> <p><img src="https://i.stack.imgur.com/TpcOX.jpg" alt="http://img21.imageshack.us/img21/7865/screenshotizn.png"></p> <p><a href="https://stackoverflow.com/questions/1260670/rich-gui-application-in-delphi">From Here</a>, then I thought, if I draw image on form (OnPaint) then set AlphaBlend ON, I could achieve this effect but with no success, when the whole form is transparent, main needed effect is not achieved, no bg pic behind memo.</p> <p><img src="https://i.stack.imgur.com/dxsBB.png" alt="enter image description here"></p> <p>The effect I want to achieve: (it's done in photoshop) <img src="https://i.stack.imgur.com/U3FPM.png" alt="enter image description here"></p> <p>Is this possible? if is, how? (i don't ask for full src code anybody, just article or little example if possible, or direction, whatever just the way i can understand it)</p> <p>thnx for attention.</p> <hr> <p>I've found the solution, create alphablended form on the form with image background, then add memo on the added form and align it to client, not the best way, but it works fine: <img src="https://i.stack.imgur.com/ujRKx.png" alt="enter image description here"></p> <pre><code>procedure TForm1.Button1Click(Sender: TObject); var MM : TMyMemo; frm : TForm; begin frm := TForm.Create(Form1); frm.BorderStyle := bsNone; frm.AlphaBlend := true; frm.AlphaBlendValue := 150; frm.Left := Form1.Left + 90; frm.Top := Form1.Top + 90; frm.Width := 300; frm.Height := 300; frm.Position := poDesigned; frm.Visible := true; MM := TMyMemo.Create(frm); MM.Parent := frm; MM.BorderStyle := bsNone; MM.ParentColor := False; MM.Align := alClient; MM.Color := clBlack; MM.Font.Color := clWhite; MM.Font.Name := 'Sylfaen'; MM.Font.Size := 11; MM.Visible := True; frme := True; end; </code></pre> <p>But there is another problem, when i press on memo, background form loses focus, when i set new forms' parent to Form1,above problem is solved but transparent effect is gone (window is still transparent but you can see through bg window without visible background) how can i solve this problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload