?
Solved

Child/Parent Form Transparency Problem

Posted on 2011-03-10
9
Medium Priority
?
1,286 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:Chris Nillissen
[X]
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
  • 3
  • 3
  • 3
9 Comments
 
LVL 38

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:Chris Nillissen
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 38

Expert Comment

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

have you tried this instead ?
Form2.Parent := Form1
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Expert Comment

by:Ephraim Wangoya
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 38

Expert Comment

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

Expert Comment

by:Ephraim Wangoya
ID: 35141762
You tell me
0
 

Author Comment

by:Chris Nillissen
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:Chris Nillissen
ID: 35170028
There must be a way to do this?
0
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month12 days, 3 hours left to enroll

752 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