Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MFC CDialog hosting WPF components

MFC CDialog hosting WPF components

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++visual-studiowpf
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 8833981
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • M Member 8833981

      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

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      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

      M 1 Reply Last reply
      0
      • D David Crow

        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

        M Offline
        M Offline
        Member 8833981
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups