Solved

Child/Parent Form Transparency Problem

Posted on 2011-03-10
9
1,213 Views
Last Modified: 2012-05-11
I have a parent form that is alphablended, but I dont want its child form to be transparent at all. The problem I am having is that Delphi seems to make the child form inherit the alphablending properties from its parent. I have tried all obvious things bu to no avail.

Under Visual Basic 6 it seems to work fine, but now that I am porting this application to Delphi this behavour is different.

Is there any way to stop this?
0
Comment
Question by:ChrisNillissen
  • 3
  • 3
  • 3
9 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 35096030
look in the dfm code

it will start with inherited FormX

and properties you have changed will be listed

compare the dfm of the parent with the dfm of the child
to see differences

defaults are not saved, unless explicit indicated

property Opaque default False stored True;
0
 

Author Comment

by:ChrisNillissen
ID: 35102426
Sorry I am not creating an inhereted form. Let me rephrase the question a bit to make it clearer:

I create a form (Form1) that I am using as a background form. I set its AlphaBlend property to True and set its AlphaBlendValue to 128, making the form transparent.

I then create a second, totally independent, form (Form2) with its AlphaBlend property to False (I even implicitly set this when creating the form). I then set Form1 as the parent window of Form2 (via Form2.ParentWindow = Form1.Handle).

This makes the child window take on the parent windows AlphaBlend Properties which then cant be independently changed. I am unable to modify the Alpha properties on Form2 at all.

I require Form2 to be a child of Form1 but cant have the Alpha properties inherited.
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 35106440
Form2.ParentWindow = Form1.Handle

have you tried this instead ?
Form2.Parent := Form1
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 32

Expert Comment

by:ewangoya
ID: 35111745

Interesting my comment never came through yesterday

This is by design, you can't change it at least I have never come a cross a way of doing it. Even if you override the form, still won't work

@Geert
Form2.Parent := Form1
This makes no difference
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 35141616
no ?
then what does ?
0
 
LVL 32

Expert Comment

by:ewangoya
ID: 35141762
You tell me
0
 

Author Comment

by:ChrisNillissen
ID: 35143822
Yes I have tried Form2.Parent := Form1 and it has the same effect as Form2.ParentWindow = Form1.Handle.

It seems strange that this behavour cant be changed. Its fine in other languages just not Delphi.
0
 

Author Comment

by:ChrisNillissen
ID: 35170028
There must be a way to do this?
0
 
LVL 32

Accepted Solution

by:
ewangoya earned 500 total points
ID: 35237562

Apparently not in Delphi.
You can try placing a component that will not support transparency on the child form.

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Run video youtube webbrowse 10 61
creating threads in delphi 1 101
Firemonkey DbLookupComboBox equivalent ? 2 47
Tidtcpserver listening on multiports? 1 26
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question