Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 133771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:29:34+00:00 2026-05-11T06:29:34+00:00

I have a 2 monitors and a WinForm app that launches a WPF window.

  • 0

I have a 2 monitors and a WinForm app that launches a WPF window. I want to get the screen that the WinForm is on, and show the WPF window on the same screen. How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:29:34+00:00Added an answer on May 11, 2026 at 6:29 am

    WPF doesn’t include the handy System.Windows.Forms.Screen class, but you can still use its properties to accomplish your task in your WinForms application.

    Assume that this means the WinForms window and _wpfWindow is a defined variable referencing the WPF Window in the example below (this would be in whatever code handler you set to open the WPF Window, like some Button.Click handler):

    Screen screen = Screen.FromControl(this); _wpfWindow.StartupLocation = System.Windows.WindowStartupLocation.Manual; _wpfWindow.Top = screen.Bounds.Top; _wpfWindow.Left = screen.Bounds.Left; _wpfWindow.Show(); 

    The above code will instantiate the WPF Window at the Top-Left corner of the screen containing your WinForms Window. I’ll leave the math to you if you wish to place it in another location like the middle of the screen or in a ‘cascading’ style below and to the right of your WinForms Window.

    Another method that gets the WPF Window in the middle of the screen would be to simply use

    _wpfWIndow.StartupLocation = System.Windows.WindowStartupLocation.CenterScreen 

    However, this isn’t quite as flexible because it uses the position of the mouse to figure out which screen to display the WPF Window (and obviously the mouse could be on a different screen as your WinForms app if the user moves it quickly, or you use a default button, or whatever).

    Edit: Here’s a link to an SDK document about using InterOp to get your WPF Window centered over the non-WPF Window. It does basically what I was describing in terms of figuring out the math, but correctly allows you to set the WPF Window’s ‘Owner’ property using the Window’s HWND.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a service monitor app that monitors the status of three other servers
I'm writing an app that monitors the user's location. I have a CLLocationManager object
I have this app written in VB.Net with winforms that shows some stats and
I have a winform app that needs to be aware of when a SQL
I have a Winform app that has a backgroundWorker thread and does all operations
I have an event that monitors for changes to a datagridview. I don't want
I have some Linux code that monitors our hardware by collecting temperatures, voltages, and
I am working on a winform app for a touch screen monitor. The app
I'm hosting a WCF service inside a winform app. I want to monitor when
I have a 32 bit .Net application winform that invokes a C++ dll. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.