Click here to Skip to main content
15,038,237 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
Hello! Sorry for my English.
With using C++Builder I have created a window that is based on the .png image (using the function SetWindowLong (), UpdateLayeredWindow, etc.).
All works fine. But I have a problem - all the controls that I put on the form is not visible.
I read that solution is to use a special way of painting of controls. But what?
Help me please - tell me how to display the buttons, text fields, labels and other controls on a layered window?
Thanks!
Posted
Comments
Philippe Mori 11-Jun-13 18:18pm
   
One guess would be that you have to paint yourself controls into a memory DC and then copy them. It might be that layered Windows are not really intended for that purpose of displaying child controls.

Do you have images that could better explain what you are trying to do. I know that Aero glass does not works well with child controls so it might be similar.

One possibility is too have distinct top level windows and then handle synchronisation between them for thing like moving including minimizing and maximizing. I use that technique to have part of a window semi-transparent. In fact, I have an hole in the main Windows and the semi-transparent one is moved and sized to fill that hole. I think that the hole is made using region and I don't know on what Opacity is based at the API level.

1 solution

Try to use BringToFront() or SendToBack() methods.
C++
myPixFrame->SendToBack();
myTextBox->BringToFront();
   
Comments
Igor-84 10-Jun-13 6:47am
   
This did not help. The controls are still invisible. It happen because the controls placed on the layer which has transparency. But how to display them?
skydger 10-Jun-13 7:42am
   
Do these controls visible at design time? Is it possible that controls have the same color as transparent one?
Igor-84 10-Jun-13 8:46am
   
Yes, at design time all controls are visible, and I do not set transparency color for controls. Are there any ideas?
skydger 11-Jun-13 4:23am
   
Please update your question to provide us a code sample for controls initialization.

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