MFC CDialog hosting WPF components
-
Hi, I'm integrating some some WPF controls into a MFC dialog box. One of the control is a media player that shows live video. The second one is a label that shows the current video time. What I need is to have is the label on top of the media player. The label should only display the time, so its background needs to be transparent. Right now, I have the video player running fine inside the dialog box, but I am unable to have the time displayed as I wish. It just overlap the video player. Both WPF components were creating by following instructions from this link. https://msdn.microsoft.com/en-us/library/ms742522(v=vs.110).aspx#hosting_a_wpf_page[^] I try to set the label with a transparent background. timeLabel->Background = gcnew System::Windows::Media::SolidColorBrush (System::Windows::Media::Colors::Transparent); But the label background is shown black. I also try to set the Transparent flag of the MFC CDialog to true, but it didn't have any effect. How can I that fixed? Do I need to set up something special when I instantiate the WPF controls? Do I need to call some functions from inside the MFC dialog box? Thanks, Alain Migeon
-
Hi, I'm integrating some some WPF controls into a MFC dialog box. One of the control is a media player that shows live video. The second one is a label that shows the current video time. What I need is to have is the label on top of the media player. The label should only display the time, so its background needs to be transparent. Right now, I have the video player running fine inside the dialog box, but I am unable to have the time displayed as I wish. It just overlap the video player. Both WPF components were creating by following instructions from this link. https://msdn.microsoft.com/en-us/library/ms742522(v=vs.110).aspx#hosting_a_wpf_page[^] I try to set the label with a transparent background. timeLabel->Background = gcnew System::Windows::Media::SolidColorBrush (System::Windows::Media::Colors::Transparent); But the label background is shown black. I also try to set the Transparent flag of the MFC CDialog to true, but it didn't have any effect. How can I that fixed? Do I need to set up something special when I instantiate the WPF controls? Do I need to call some functions from inside the MFC dialog box? Thanks, Alain Migeon
Member 8833981 wrote:
I try to set the label with a transparent background. timeLabel->Background = gcnew System::Windows::Media::SolidColorBrushSystem::Windows::Media::Colors::Transparent);
This looks like Managed code. Might try the other forum.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Member 8833981 wrote:
I try to set the label with a transparent background. timeLabel->Background = gcnew System::Windows::Media::SolidColorBrushSystem::Windows::Media::Colors::Transparent);
This looks like Managed code. Might try the other forum.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
Thanks for suggestion. I have just done so. But I'm not sure that the answer to my problem is inside the WPF part. It can also be in the MFC one.