Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want to have a Transparent form as child to another form.

For creating a Transparent form (say this form is: NewChild), I have set the "TransparencyKey" property and "BackColor" property to same color (say Red)

Note: My parent form BackColor do not have Red color.

Now in the Parent form on some button Click, I have code like this:
C#
NewChild child = new NewChild();
int iErro = SetParent(child.Handle, (int)this.Handle); // Set parent to this child form
child.Location = new Point(300, 300);
child.Size = new Size(300, 130);
child.Show();


I can able to see the child transparent form inside parent form in Windows 8.0, 8.1, 10.0.

BUT could not see the child form in WINDOWS 7.0.

Please let me know if this is an issue with Win 7.0 OS or any thing I am missing
Posted
Comments
Richard Deeming 22-Sep-15 8:32am    
If I recall correctly, Windows 8 and higher will have .NET 4.5 installed by default, whereas Windows 7 will only have .NET 4.0 installed. Have you tried installing 4.5 or 4.6 on the Windows 7 computer to see if that fixes the bug?
Lakamraju Raghuram 22-Sep-15 23:25pm    
I have checked on a machine having Windows 7 and .NET 4.5. The issue is there too
Maciej Los 27-Sep-15 17:47pm    
Sergey Alexandrovich Kryokov[^] had mentioned several times on this forum: forget about child-parent relationship, because it's NOT really operational.
Please, see His answers[^] to similar questions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900