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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:50:53+00:00 2026-05-24T23:50:53+00:00

I have a C# app with two forms. The first one is the main

  • 0

I have a C# app with two forms.

The first one is the main form which should always be open.

The second one is a preview pane which the user can enable.

When the user selects to show the preview pane (menu option), the preview pane gets opened.

Which is what I want.

However I want to prevent the preview pane from ever getting the focus. Otherwise if users want to access to menu (which is on the main form) they first click and it looks like nothing is happening (but in fact the focus switches from preview -> main).
Only after the second click they can access the menu.

So I thought I had a pretty simple solution:

If the preview ever gets the focus just set the focus to the main form.

However it looks like I cannot access the main form from the preview pane.

To show the preview pane I simply do (on the main form):

QRcodeGenerator.QrCodePreview preview = new QRcodeGenerator.QrCodePreview();
preview.show();

I tried to give the focus back the main form by doing (on the preview window):

private void QrCodePreview_GotFocus(object sender, EventArgs e)
{
    QrCodeGenerator.QrCodeSampleApp.focus();
}

But as stated it looks like I cannot access it.

form gone

  • 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-24T23:50:54+00:00Added an answer on May 24, 2026 at 11:50 pm

    youll need to pass the instance of the mainform to the child form. So create a property on the preview form that you set before you call show. Then access that instance of the main form from the instance of the preview form

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

Sidebar

Related Questions

I have written an app in C which expects two lines at input. First
I have two forms in my rails app. They both exist in separate tabs
Is it possible to have two app.config files where one app.config serves as a
I have a cocoa app with two types windows each of which requires a
I have two sprites in my app. Both should have touches enabled and both
I have two Windows Forms applications and library in one solution. Library class can
In my Asp.net MVC app, I have two methods on a controller, one for
I have two classes under QT, one to make a form, the other to
I have an app that has a centre view with two views off to
I have two UITextFields in the App as IBOutlets and I have made a

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.