Problem with Multi-Project Solution

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?MjJQb20=?=

    Problem with Multi-Project Solution

    Hello All,

    Yes, I'm back again on this subject.

    I've started again to set up the solution and I can, if you like, move
    deeper into the program, accessing various forms as I go BUT I cannot for the
    life of me work out how to get back. I have set "CommonForm s" in the
    Properties/References of StartUp.

    Just working with two projects "StartUp" & "CommonForm s" I place a parent
    form with child in "StartUp" and one form in "CommonForm s". In the "StartUp"
    child form I have the following code:

    Public Class OpenSplash

    Private Sub Button3_Click(B yVal sender As System.Object, _
    ByVal e As System.EventArg s) Handles Button3.Click

    Dim FormChild2 As New CommonForms.For m1
    FormChild2.MdiP arent = Background
    FormChild2.Show ()
    Me.Hide()
    End Sub
    End Class

    This closes the OpenSplash screen and shows Form1. How do I close Form1 and
    get back to OpenSplash?

    With this solved I can move forward, I'm sure.

    Best Rgds,
    22Pom
  • Family Tree Mike

    #2
    Re: Problem with Multi-Project Solution

    Try changing:

    FormChild2.Show ()
    Me.Hide()

    to:

    Me.Visible = False
    FormChild2.Show Dialog()
    Me.Visible = True

    Does that achieve what you wanted?

    "22Pom" <22Pom@discussi ons.microsoft.c omwrote in message
    news:4039592A-43C9-4964-8253-C2E7F27A3A6F@mi crosoft.com...
    Hello All,
    >
    Yes, I'm back again on this subject.
    >
    I've started again to set up the solution and I can, if you like, move
    deeper into the program, accessing various forms as I go BUT I cannot for
    the
    life of me work out how to get back. I have set "CommonForm s" in the
    Properties/References of StartUp.
    >
    Just working with two projects "StartUp" & "CommonForm s" I place a parent
    form with child in "StartUp" and one form in "CommonForm s". In the
    "StartUp"
    child form I have the following code:
    >
    Public Class OpenSplash
    >
    Private Sub Button3_Click(B yVal sender As System.Object, _
    ByVal e As System.EventArg s) Handles Button3.Click
    >
    Dim FormChild2 As New CommonForms.For m1
    FormChild2.MdiP arent = Background
    FormChild2.Show ()
    Me.Hide()
    End Sub
    End Class
    >
    This closes the OpenSplash screen and shows Form1. How do I close Form1
    and
    get back to OpenSplash?
    >
    With this solved I can move forward, I'm sure.
    >
    Best Rgds,
    22Pom

    Comment

    • Miro

      #3
      Re: Problem with Multi-Project Solution

      You cannot 'close' the main form that starts off the application.
      The most you can do is 'hide' it and show it.

      Miro

      "22Pom" <22Pom@discussi ons.microsoft.c omwrote in message
      news:4039592A-43C9-4964-8253-C2E7F27A3A6F@mi crosoft.com...
      Hello All,
      >
      Yes, I'm back again on this subject.
      >
      I've started again to set up the solution and I can, if you like, move
      deeper into the program, accessing various forms as I go BUT I cannot for
      the
      life of me work out how to get back. I have set "CommonForm s" in the
      Properties/References of StartUp.
      >
      Just working with two projects "StartUp" & "CommonForm s" I place a parent
      form with child in "StartUp" and one form in "CommonForm s". In the
      "StartUp"
      child form I have the following code:
      >
      Public Class OpenSplash
      >
      Private Sub Button3_Click(B yVal sender As System.Object, _
      ByVal e As System.EventArg s) Handles Button3.Click
      >
      Dim FormChild2 As New CommonForms.For m1
      FormChild2.MdiP arent = Background
      FormChild2.Show ()
      Me.Hide()
      End Sub
      End Class
      >
      This closes the OpenSplash screen and shows Form1. How do I close Form1
      and
      get back to OpenSplash?
      >
      With this solved I can move forward, I'm sure.
      >
      Best Rgds,
      22Pom

      Comment

      • =?Utf-8?B?MjJQb20=?=

        #4
        Re: Problem with Multi-Project Solution

        Hi Family Tree Mike,

        Sorry mate, no it doesn't. I have tried to use the following code in Form1,
        as I have done in a single project solution, but in this case I get the error
        "Formchild2 is not declared".

        Public Class Form1

        Private Sub Button1_Click(B yVal sender As System.Object, _
        ByVal e As System.EventArg s) Handles Button1.Click

        Dim FormChild2 As New StartUp.Openspl ash
        FormChild2.MdiP arent = background
        FormChild2.Show ()
        Me.Hide()
        End Sub
        End Class

        There is probably a simple way of doing this, like most other problems I've
        had in the past, but I cannot work it out.

        Best Rgds,
        22Pom

        "Family Tree Mike" wrote:
        Try changing:
        >
        FormChild2.Show ()
        Me.Hide()
        >
        to:
        >
        Me.Visible = False
        FormChild2.Show Dialog()
        Me.Visible = True
        >
        Does that achieve what you wanted?
        >

        Comment

        • =?Utf-8?B?MjJQb20=?=

          #5
          Re: Problem with Multi-Project Solution

          Hi Miro,

          I don't want to close off the application with my code I just want to close
          the current form and go back to the previous form. I have tried this code
          but I get the error that Formchild2 is not declared.

          Public Class Form1

          Private Sub Button1_Click(B yVal sender As System.Object, _
          ByVal e As System.EventArg s) Handles Button1.Click

          Dim FormChild2 As New StartUp.Openspl ash
          FormChild2.MdiP arent = background
          FormChild2.Show ()
          Me.Hide()
          End Sub
          End Class

          If I can't overcome this problem then I'm lost. My current Single Solution
          project has well over 70 Forms, Modules etc in it and I was advised that the
          only real way to develop such a large program was to go to the Multi-Project
          Solution.

          Best Rgds,
          22Pom


          "Miro" wrote:
          You cannot 'close' the main form that starts off the application.
          The most you can do is 'hide' it and show it.
          >
          Miro
          >

          Comment

          • Branco Medeiros

            #6
            Re: Problem with Multi-Project Solution

            22Pom wrote:
            <snip>
            Just working with two projects "StartUp" & "CommonForm s" I place a parent
            form with child in "StartUp" and one form in "CommonForm s". In the "StartUp"
            child form I have the following code:
            >
            Public Class OpenSplash
            >
                Private Sub Button3_Click(B yVal sender As System.Object, _
                                ByVal e As System.EventArg s) Handles Button3.Click
            >
                    Dim FormChild2 As New CommonForms.For m1
                    FormChild2.MdiP arent = Background
                    FormChild2.Show ()
                    Me.Hide()
                End Sub
            End Class
            >
            This closes the OpenSplash screen and shows Form1. How do I close Form1 and
            get back to OpenSplash?
            <snip>

            I'm not sure if I really understand your setup, but since it seems
            Opensplash will be controlling the other forms' lifetime, you could
            have a form variable *with events* in Opensplash, so it could know
            when the current form closed.

            <example>
            Public Class OpenSplash
            Private WithEvents CurrentForm As Form
            Private Sub Button3_Click(B yVal sender As System.Object, _
            ByVal e As System.EventArg s) Handles Button3.Click
            >
            Dim FormChild2 As New CommonForms.For m1
            '***********
            CurrentForm = FormChild2
            '***********
            FormChild2.MdiP arent = Background
            FormChild2.Show ()
            Me.Hide()
            End Sub
            Private Sub CurrentForm_For mClosed( _
            ByVal sender As Object, _
            ByVal e As FormClosedEvent Args _
            ) Handles CurrentForm.For mClosed

            CurrentForm = Nothing
            Me.Show()

            End Sub
            End Class
            </example>

            Regards,

            Branco.

            Comment

            • =?Utf-8?B?MjJQb20=?=

              #7
              Re: Problem with Multi-Project Solution

              Hi Branco Mendeiros,

              I thank you for you code but it operates in the same fashion that I'm
              currently using.

              My program starts with the OpenSplash screen on a background and the user,
              by clicking a button moves forward to screen 2, and this automatically closes
              screen 1. So far so good - this I can achieve. What bugs me is closing
              screen 2 and returning to screen 1.

              This is only the start. I have 4 Product groups which in turn have 5
              Products which in turn etc, so as you can see there are a lot of separate
              screens. At the moment I have a Single Solution with some 70 odd Forms,
              Modules etc ,which works ok up till now. I cannot keep adding forms as this
              is causing the program to play up.

              I think that I've opened up a massive can of worms with this problem, a
              problem that I don't think has come up before.

              Thanks for your time.

              Best Rgds
              22Pom

              "Branco Medeiros" wrote:
              >
              I'm not sure if I really understand your setup, but since it seems
              Opensplash will be controlling the other forms' lifetime, you could
              have a form variable *with events* in Opensplash, so it could know
              when the current form closed.
              >
              <example>
              Public Class OpenSplash
              >
              Private WithEvents CurrentForm As Form
              >
              Private Sub Button3_Click(B yVal sender As System.Object, _
              ByVal e As System.EventArg s) Handles Button3.Click

              Dim FormChild2 As New CommonForms.For m1
              '***********
              CurrentForm = FormChild2
              '***********
              FormChild2.MdiP arent = Background
              FormChild2.Show ()
              >
              Me.Hide()
              End Sub
              >
              Private Sub CurrentForm_For mClosed( _
              ByVal sender As Object, _
              ByVal e As FormClosedEvent Args _
              ) Handles CurrentForm.For mClosed
              >
              CurrentForm = Nothing
              Me.Show()
              >
              End Sub
              >
              End Class
              </example>
              >
              Regards,
              >
              Branco.
              >

              Comment

              • Branco Medeiros

                #8
                Re: Problem with Multi-Project Solution

                Hi, 22Pom!

                When you say "What bugs me is closing screen 2 and returning to screen
                1", what exactly do you mean? Do you want to show "screen 1" again
                after closing "screen 2"?

                Can you provide more information about what you are trying to
                acomplish? Maybe if you clarify that we can find out how to achieve
                it.

                Regards,

                Branco.


                On Sep 21, 12:35 am, 22Pom <22...@discussi ons.microsoft.c omwrote:
                Hi Branco Mendeiros,
                >
                I thank you for you code but it operates in the same fashion that I'm
                currently using.
                >
                My program starts with the OpenSplash screen on a background and the user,
                by clicking a button moves forward to screen 2, and this automatically closes
                screen 1.  So far so good - this I can achieve.  What bugs me is closing
                screen 2 and returning to screen 1.
                >
                This is only the start.  I have 4 Product groups which in turn have 5
                Products which in turn etc, so as you can see there are a lot of separate
                screens.  At the moment I have a Single Solution with some 70 odd Forms,
                Modules etc ,which works ok up till now.  I cannot keep adding forms asthis
                is causing the program to play up.
                >
                I think that I've opened up a massive can of worms with this problem, a
                problem that I don't think has come up before.
                >
                Thanks for your time.
                >
                Best Rgds
                22Pom
                <snip>

                Comment

                • =?Utf-8?B?MjJQb20=?=

                  #9
                  Re: Problem with Multi-Project Solution

                  Hi Branco Medeiros,

                  Yes that's it. My program starts off with the opening splash screen (1) the
                  user then moves forward to the next screeen (2) which is where they can
                  select a product range from a set of (4). Each of these sets has a further
                  (5) products, and so the process continues until they have reached the
                  product they want and the selection begins, hence the number of forms.
                  modules etc in the program, currently stands at 74 with at least another 25
                  to go.

                  What I need to be able to do is reverse out of an area reached. This is the
                  problem. I could attach a copy of what I have but I don't see how I can do
                  this in this forum. What I will do is post a link to another Forum so you
                  can see what I have.

                  Best Rgds,
                  22Pom

                  "Branco Medeiros" wrote:
                  Hi, 22Pom!
                  >
                  When you say "What bugs me is closing screen 2 and returning to screen
                  1", what exactly do you mean? Do you want to show "screen 1" again
                  after closing "screen 2"?
                  >
                  Can you provide more information about what you are trying to
                  acomplish? Maybe if you clarify that we can find out how to achieve
                  it.
                  >
                  Regards,
                  >
                  Branco.
                  >
                  >

                  Comment

                  Working...