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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer There's a summary of this problem on Sun's forums... seems… May 11, 2026 at 12:37 pm
  • added an answer You have an extra comma somewhere in your javascript. EDIT:… May 11, 2026 at 12:37 pm
  • added an answer If you know that the DataItem is a certain type… May 11, 2026 at 12:37 pm

Related Questions

I have a 2.4 MB XML file, an export from Microsoft Project (hey I'm
I have a 2 dimensional array, like so: char[,] str = new char[2,50]; Now,
I have a 2-dimensional array of objects and I basically want to databind each
I have a class that processes a 2 xml files and produces a text
Hi I have a JSON object that is a 2-dimentional array and I need
I have a legacy VB6 application that was built using MSDE. As many client's
I have a silverlight 2 beta 2 application that accesses a WCF web service.
I remember using a program, some years back, that allowed me to fine-tune my
For my current C++ project I need to detect a unique string for every

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.