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 240403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:39:49+00:00 2026-05-11T20:39:49+00:00

This is a very trivial problem but I can’t seem to find a way

  • 0

This is a very trivial problem but I can’t seem to find a way of solving it. It’s annoying me because I feel I should know the answer to this, but I’m either searching for the wrong terms or looking at the wrong methods and properties.

I have a configuration dialog that’s called from two places.

The first is from the button on the form which is working correctly – as you’d expect.

The second is from a context menu on the notifyIcon in the system tray, but here it appears at the top left of the screen. Ideally I’d like it to appear centered on the primary screen, or perhaps close to the system tray.

  • I’ve tried setting the Location, but this appears to be overridden when dialog.ShowDialog() is called.

  • I’ve tried using the dialog.ShowDialog(IWin32Window) overload, but that didn’t seem to like me passing null as the window handle.

  • I’ve tried using dialog.Show() instead, but (and this is where I could be going wrong) setting the location doesn’t appear to give consistent results.

  • I’ve even tried setting the dialog.Parent property – which of course raised an exception.

I just know that I’m going to realise that the answer is obvious when I (hopefully) see some answers, but at the moment I’m completely stuck.

Thanks for the answers – as I suspected it was obvious, but as usual I’d got myself stuck into looking down the wrong route. The even more annoying thing is that I’ve used this property from the designer too.

  • 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. Editorial Team
    Editorial Team
    2026-05-11T20:39:49+00:00Added an answer on May 11, 2026 at 8:39 pm

    You can set the Form.StartPosition property to FormStartPosition.Manual and then set the Form.Location property to your desired location. When you call ShowDialog the form should show up in the desired location.

    MyForm frm = new MyForm();
    frm.StartPosition = FormStartPosition.Manual;
    frm.Location = new Point(10, 10);
    frm.ShowDialog();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably very trivial but I can't for the life of me find
I'm very sure this problem has been solved, but I can't find any information
Probably a very trivial problem. I have an object that looks like this: @PersistenceCapable
I'm using this very handy plugin to sort elements. But comparing elements on a
I suspect this is a very trivial question. I'm writing a PHP script to
I'm experiencing a very strange problem... The following trivial test code works as it
I guess this problem is really about performance, but I'm trying to get a
I've got a very simple problem, but the solution is proving very elusive. Here's
I have problem that seems to be rather trivial but I was not able
This is probably a very trivial question. I am trying to use the stanford

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.