How to determine if form/window is WPF or WinForm?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How to determine if form/window is WPF or WinForm?

  1. #1
    Join Date
    Sep 2005
    Posts
    3

    Question How to determine if form/window is WPF or WinForm?

    Hi all-

    I apologize in advance if I don't have the terminology quite correct- I've done almost no WPF programming (yet!)

    I have an application that I need to support that has a sort of a plug-in client form architecture. The client form can be WinForm or WPF. I need to do a InvokeRequired check if WinForm or Dispatcher.CheckAccess if WPF. I have a handle to the client. Right now I have code that works that has try/catches and if the InvokeRequired check fails, then I assume it's a WPF window and I try the CheckAccess. I'm interested in coming up with a more elegant solution. I have a handle to the form- is there a way for me to programmatically determine if my window is WPF or WinForm without throwing errors from try/catch blocks?

    Thanks a bunch! AL

  2. #2
    Join Date
    Sep 2005
    Posts
    3

    Re: How to determine if form/window is WPF or WinForm?

    I don't see an "edit" button- I have a IWin32Window that I'm dealing with (which is a WPF window or a WinForm window...)

    Thanks, AL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center