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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:14:21+00:00 2026-06-15T16:14:21+00:00

I have an MDI parent form that may open a child form called Order.

  • 0

I have an MDI parent form that may open a child form called “Order”. Order forms have a button that allows the user to print the order. The Order form has a print size variable defined at the beginning:

Public Class Order

Public psize As String 

    Private Sub button_order_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles process_order.Click
  ' Code to handle the order and then print, etc 

Now the parent form has a psize variable as well, which is set to a default of “A4”.
Only when someone clicks on one of the menu items on the Parent window’s menu strip will this happen:

psize = "A6"

By default, whenever the parent window opens up a new Order form, I need it to set the child form’s psize variable to its own psize value. Something like this:

    Dim f As Form
    f = New Order
    f.MdiParent = Me
    f.psize = Me.psize ' BUT THIS LINE DOESN'T WORK
    f.Show()

I get the error that f.psize is not a member of the form.
I know that passing variables to and from the MDI parent and child is quite common but despite trying out a few options I saw here, it doesn’t seem to be working. Is this the wrong approach?

  • 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-15T16:14:23+00:00Added an answer on June 15, 2026 at 4:14 pm

    The reason the property is not available is because you are using the wrong type for the variable. The base Form type does not define that property. Instead, your derived Order type does. You could do something like this:

    Dim f As Order
    f = New Order
    f.MdiParent = Me
    f.psize = Me.psize
    f.Show()
    

    UPDATE

    As you have said in comments below, what you really need to do is to be able to share a dynamic setting between all your forms so that you can change the setting at any time and have it affect all your forms that have already been displayed. The best way to do that, would be to create a new class that stores all your shared settings, for instance:

    Public Class Settings
        Public PaperSize As String = "A6"
    End Class
    

    As you can see, by doing so, you can easily centralize all your default settings in your settings class, which is an added benefit. Then, you need to change the public property in your Order form to the new Settings type, for instance:

    Public Class Order
        Inherits Form
    
        Public Settings As Settings
    End Class
    

    Then, you need to create your shared settings object in your MDI Parent form, and then pass it it to each of your Order forms as they are created:

    Public Class MyParentForm
        Private _settings As New Settings()
    
        Private Sub ShowNewOrderForm()
            Dim f As New Order()
            f.MdiParent = Me
            f.Settings = _settings
            f.Show()
        End Sub
    
        Private Sub ChangePaperSize(size As String)
            _settings.PaperSize = size
        End Sub
    End Class
    

    Then, since the parent form and all the child Order forms share the same Settings object, and change made to that Settings object will be seen immediately by all the forms.

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

Sidebar

Related Questions

I have a MDI container form, and some child forms that update their title
I have an MDI parent container (form style: none) that fits to 1280x800. Child
I have a form that acts as MDI parent form and several other forms
I have an MDI form and several number of child forms inside that MDI.
I have an MDI parent form that creates many MDI children at run time.
I want to run a MDI child form its parent. For example I have
I have a MDI Child Form which contains a DataGridView that is updated continuously
We have an MDI form which contains some number of child forms which have
I have a save button in MDI parent form and I want to call
I have a MDI parent form. When user presses Enter I want the Application

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.