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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:01:10+00:00 2026-06-08T16:01:10+00:00

I my Main Form, there are two buttons that will display other Forms (each

  • 0

I my Main Form, there are two buttons that will display other Forms
(each button displays a single new form)
now, my main form class name is MyMainForm ..
The other two forms class names are: MySubForm1 , MySubForm2
the problem is that I’m having some trouble accessing some of the stuff in MyMainForm
inside of the sub forms ..

Is it a good idea to have them all partial ?

  • 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-06-08T16:01:11+00:00Added an answer on June 8, 2026 at 4:01 pm

    Sounds to me like you are expecting to be able to access private members of a form from a different form.

    You need to have a reference from the “SubForms” to the parent form should you wish to be able to access any of its members.

    Secondly, you won’t be able to access “private” members. Again two options, either create public get/set methods for the members you want, or alternatively change the access modifier of objects to public/internal.

    Post some more code explaining what you have tried and what you are trying to achieve and I may be able to point you in the correct direction.

    Also, in more direct response to your question, partials have nothing to do with what you are trying to do, they are for extending existing classes whilst maintaining separation of code in logical files.

    public class Main : Form
    {
         // assuming here you have three textboxes
    
         private void button1_Click(eventargs etc)
         {
             OtherForm otherForm = new OtherForm() { Text1 = textbox1.Text, 
                                                     Text2 = textbox2.Text,
                                                     Text3 = textbox3.Text };
             otherForm.Show();
         }
    
    }
    
    public class OtherForm : Form
    {
        public String Text1 { get; set; }
        public String Text2 { get; set; }
        public String Text3 { get; set; }
    }
    

    With this setup, your OtherForm has a copy of the text values as they were at the time of the forms creation.

    By the sounds of your question and following comments, this is what you expect in your scenario, but I will say again, show us some code and we can help better. Partials is definately not the right answer.

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

Sidebar

Related Questions

I've a dgv on my main form, there is a button that opens up
Backdrop: There are two forms, the main application form and a form to edit
I designed two forms: Form1 and Form2 . Form1 is the main form. There
Scenario I have a Windows Forms Application. Inside the main form there is a
I'm using Microsoft Visual C# 2008 Express. In my main form, there's that X
I have a winforms app with a main form (fMain) and two child forms
I have a main form that users fill out, and at the bottom there
I have a main Form. There is a linklabel. If i click on it,
I have a VB6 app. There is a main form. It houses a user
I have a project with a main MDI form. There is a child MDI

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.