Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Child/Parent Form Transparency Problem

Posted on 2011-03-10
9
1,227 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to convert memory stream to PDF file 6 107
Dev express lookupcombo 3 34
How to load 2 images in same column in Delphi 2 57
Firemonkey BASS_Init into a thread 17 30
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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