locked
Regarding the host WPF control into Windows forms application RRS feed

  • Question

  • Hi All,

    I am facing the problem while hosting the WPF control into windows forms application, actually in my WPF control has some context menus in which one context menu's IsOpen property will be set to true at a time. but it's not visible in my winforms application but it's working fine in my test windows form application.

    do i need to do any settings/focus to solve this problem?

    Advance Thanks for your help.

    Regards,

    Sathish

     

     

     


    Regards, Sathish (Do what you want , Don't do what you can)!
    • Moved by CoolDadTx Tuesday, December 14, 2010 2:36 PM WPF related (From:Visual C# General)
    Tuesday, December 14, 2010 11:33 AM

Answers

  • Hi Sathish,

    Welcome to our forum, I am glad to discuss this issue with you.

    -->    it's not visible in my winforms application but it's working fine in my test windows form application.

    Based on the description I think it is hard to find the root cause of your issue.

    As far as I know, I think if you set your Menu's IsOpen property is True, then it will be seen in your WinFrom application.

    About your second concern:

    -->    do i need to do any settings/focus to solve this problem?

    Could you share more information or a simple sample with me to reproduce your issue, and then I will do my best to resolve your issue as soon as possible.

     

    Best regards,

     


    Sheldon _Xiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Sheldon _Xiao Friday, December 24, 2010 5:44 AM
    Thursday, December 16, 2010 8:20 AM
  • Hi Sheldon _Xiao,

    Thank you so much for your response...

    Likely i could able to figure out the problem, it was because of focus problem.

    In WPF control RightMouseButtonUp event I setting the IsOpen property for one of my context menu but didn't put e.Handled is true, so in my application some where also handling the same event and settings the focus to some other component because of that WPF context menu close's automatically.

    After adding the one line of code in RightMouseButtonUp event solves my problem.

    e.Handled=true.

    Thank you once again for your help.

    Best Regards,

    Sathish


    Regards, Sathish (Do what you want , Don't do what you can)!
    • Marked as answer by Sheldon _Xiao Friday, December 24, 2010 5:44 AM
    Thursday, December 16, 2010 9:23 AM

All replies

  • Hi Sathish,

    Welcome to our forum, I am glad to discuss this issue with you.

    -->    it's not visible in my winforms application but it's working fine in my test windows form application.

    Based on the description I think it is hard to find the root cause of your issue.

    As far as I know, I think if you set your Menu's IsOpen property is True, then it will be seen in your WinFrom application.

    About your second concern:

    -->    do i need to do any settings/focus to solve this problem?

    Could you share more information or a simple sample with me to reproduce your issue, and then I will do my best to resolve your issue as soon as possible.

     

    Best regards,

     


    Sheldon _Xiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Sheldon _Xiao Friday, December 24, 2010 5:44 AM
    Thursday, December 16, 2010 8:20 AM
  • Hi Sheldon _Xiao,

    Thank you so much for your response...

    Likely i could able to figure out the problem, it was because of focus problem.

    In WPF control RightMouseButtonUp event I setting the IsOpen property for one of my context menu but didn't put e.Handled is true, so in my application some where also handling the same event and settings the focus to some other component because of that WPF context menu close's automatically.

    After adding the one line of code in RightMouseButtonUp event solves my problem.

    e.Handled=true.

    Thank you once again for your help.

    Best Regards,

    Sathish


    Regards, Sathish (Do what you want , Don't do what you can)!
    • Marked as answer by Sheldon _Xiao Friday, December 24, 2010 5:44 AM
    Thursday, December 16, 2010 9:23 AM
  • Hi Sathish,

    Thank you for your feedback.

    I am glad to hear that you have found the reason and resolved your issue.

    Could you close your thread as "Answered", and If you have any difficulty in future programming, please come back and post a new thread.

     

    Best regards,


    Sheldon _Xiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 16, 2010 9:57 AM