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. Other Discussions
  3. The Weird and The Wonderful
  4. Undoubtedly this is my own ignorance in glorious action but...

Undoubtedly this is my own ignorance in glorious action but...

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpc++wpf
5 Posts 2 Posters 1 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.
  • A Offline
    A Offline
    Andy Bantly
    wrote on last edited by
    #1

    I am new to C# and WPF. I have a legacy bag of C++ code and dialogs. C# has this neat facility called "HwndHost" that lets you put legacy, message pump driven, windows inside a border control. My dialog is successfully hosted and running. The XAML also has a button with an accelerator. In my native dialog if I have an edit box and I try to type the letter of the accelerator it causes the accelerator to fire and the letter to be stolen from the edit box that had the focus. I can't begin to know what the heck is wrong and I suspect it has to do with weird and not so wonderful way that events are handled. My solution was to remove the accelerator or tell the user to paste in the letter 'o' when they needed it.

    M 1 Reply Last reply
    0
    • A Andy Bantly

      I am new to C# and WPF. I have a legacy bag of C++ code and dialogs. C# has this neat facility called "HwndHost" that lets you put legacy, message pump driven, windows inside a border control. My dialog is successfully hosted and running. The XAML also has a button with an accelerator. In my native dialog if I have an edit box and I try to type the letter of the accelerator it causes the accelerator to fire and the letter to be stolen from the edit box that had the focus. I can't begin to know what the heck is wrong and I suspect it has to do with weird and not so wonderful way that events are handled. My solution was to remove the accelerator or tell the user to paste in the letter 'o' when they needed it.

      M Offline
      M Offline
      Matt U
      wrote on last edited by
      #2

      Maybe this helps: http://stackoverflow.com/questions/5564158/wpf-shortcuts-are-activating-when-typing-in-hwndhost-parented-rich-edit-control[^] I don't have any experience with it personally, I just found that with a quick Google search. :-P

      djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

      A 1 Reply Last reply
      0
      • M Matt U

        Maybe this helps: http://stackoverflow.com/questions/5564158/wpf-shortcuts-are-activating-when-typing-in-hwndhost-parented-rich-edit-control[^] I don't have any experience with it personally, I just found that with a quick Google search. :-P

        djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

        A Offline
        A Offline
        Andy Bantly
        wrote on last edited by
        #3

        Thank you! That is indeed timely information. :)

        M 1 Reply Last reply
        0
        • A Andy Bantly

          Thank you! That is indeed timely information. :)

          M Offline
          M Offline
          Matt U
          wrote on last edited by
          #4

          You're very welcome. Did it provide a feasible solution? :-D

          djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

          A 1 Reply Last reply
          0
          • M Matt U

            You're very welcome. Did it provide a feasible solution? :-D

            djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

            A Offline
            A Offline
            Andy Bantly
            wrote on last edited by
            #5

            As a matter of fact it did. I had to explicitly implement the OnMnemonic function to trap the accelerator and send it along as the character that it was supposed to be. Pretty clunky. I'm surprised that the interoperability is not better but I get that is what happens when HWND based dialogs are mixed with XAML based dialogs.

            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