Basic question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • philip

    #1

    Basic question

    If the main window of my application is maximized, all the windows call by
    program (it is not a mdi application) open themselves maximized.
    The window called by the main window has this code for its Load event :


    Private Sub ShowOneImage_Lo ad(ByVal sender As System.Object, ByVal e As
    System.EventArg s) Handles MyBase.Load
    Me.BackgroundIm age = ImageFromFile(" xxx.jpg")
    Form1.Size = New System.Drawing. Size(Me.Backgro undImage.Width,
    Me.BackgroundIm age.Height)
    Me.Height = Me.BackgroundIm age.Size.Height
    Me.Width = Me.BackgroundIm age.Size.Width
    End sub

    In spite of this code, if the calling window is maximized, the called window
    is maximized.

    If the main window is not maximized, then all is good.

    Which property of the called window must I change to avoid this problem ?

    Thanks for response.




  • Oenone

    #2
    Re: Basic question

    philip wrote:[color=blue]
    > Which property of the called window must I change to avoid this
    > problem ?[/color]

    I don't think you can change this.

    The behaviour of MDI child forms is that they are either all maximized or
    none of them are. As soon as one of your child forms maximizes, so do all
    the others. You'll see this in any MDI application you can find without
    exception (to the best of my knowledge).

    The only way you can stop this is to have some of your forms set as
    non-MDI-child forms, but of course the behaviour of the windows will be
    different then as they will float in front of the MDI parent instead of
    being contained within it.

    --

    (O)enone


    Comment

    • Martin

      #3
      Re: Basic question

      Explicitly set the windowstate property of the called window to normal in
      its own load event.
      That should do the trick.

      "philip" <phil@philippe. com> wrote in message
      news:440768bf$0 $18326$8fcfb975 @news.wanadoo.f r...[color=blue]
      > If the main window of my application is maximized, all the windows call by
      > program (it is not a mdi application) open themselves maximized.
      > The window called by the main window has this code for its Load event :
      >
      >
      > Private Sub ShowOneImage_Lo ad(ByVal sender As System.Object, ByVal e As
      > System.EventArg s) Handles MyBase.Load
      > Me.BackgroundIm age = ImageFromFile(" xxx.jpg")
      > Form1.Size = New System.Drawing. Size(Me.Backgro undImage.Width,
      > Me.BackgroundIm age.Height)
      > Me.Height = Me.BackgroundIm age.Size.Height
      > Me.Width = Me.BackgroundIm age.Size.Width
      > End sub
      >
      > In spite of this code, if the calling window is maximized, the called
      > window is maximized.
      >
      > If the main window is not maximized, then all is good.
      >
      > Which property of the called window must I change to avoid this problem ?
      >
      > Thanks for response.
      >
      >
      >
      >[/color]


      Comment

      • Armin Zingler

        #4
        Re: Basic question

        "philip" <phil@philippe. com> schrieb[color=blue]
        > If the main window of my application is maximized, all the windows
        > call by program (it is not a mdi application) open themselves
        > maximized.
        > The window called by the main window has this code for its Load
        > event :
        >
        >
        > Private Sub ShowOneImage_Lo ad(ByVal sender As System.Object, ByVal e
        > As System.EventArg s) Handles MyBase.Load
        > Me.BackgroundIm age = ImageFromFile(" xxx.jpg")
        > Form1.Size = New System.Drawing. Size(Me.Backgro undImage.Width,
        > Me.BackgroundIm age.Height)[/color]

        Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
        [color=blue]
        > Me.Height = Me.BackgroundIm age.Size.Height
        > Me.Width = Me.BackgroundIm age.Size.Width
        > End sub[/color]


        Armin

        Comment

        • Martin

          #5
          Re: Basic question

          Explicitly set the windowstate property of the called window to normal in
          its own load event.
          That should do the trick.

          "philip" <phil@philippe. com> wrote in message
          news:440768bf$0 $18326$8fcfb975 @news.wanadoo.f r...[color=blue]
          > If the main window of my application is maximized, all the windows call by
          > program (it is not a mdi application) open themselves maximized.
          > The window called by the main window has this code for its Load event :
          >
          >
          > Private Sub ShowOneImage_Lo ad(ByVal sender As System.Object, ByVal e As
          > System.EventArg s) Handles MyBase.Load
          > Me.BackgroundIm age = ImageFromFile(" xxx.jpg")
          > Form1.Size = New System.Drawing. Size(Me.Backgro undImage.Width,
          > Me.BackgroundIm age.Height)
          > Me.Height = Me.BackgroundIm age.Size.Height
          > Me.Width = Me.BackgroundIm age.Size.Width
          > End sub
          >
          > In spite of this code, if the calling window is maximized, the called
          > window is maximized.
          >
          > If the main window is not maximized, then all is good.
          >
          > Which property of the called window must I change to avoid this problem ?
          >
          > Thanks for response.
          >
          >
          >
          >[/color]


          Comment

          • philip

            #6
            Re: Basic question

            BUT my application is not a MDI application...

            Thanks for your attention


            "Oenone" <oenone@nowhere .com> a écrit dans le message de news:
            8MKNf.56316$494 .28953@newsfe2-gui.ntli.net...[color=blue]
            > philip wrote:[color=green]
            >> Which property of the called window must I change to avoid this
            >> problem ?[/color]
            >
            > I don't think you can change this.
            >
            > The behaviour of MDI child forms is that they are either all maximized or
            > none of them are. As soon as one of your child forms maximizes, so do all
            > the others. You'll see this in any MDI application you can find without
            > exception (to the best of my knowledge).
            >
            > The only way you can stop this is to have some of your forms set as
            > non-MDI-child forms, but of course the behaviour of the windows will be
            > different then as they will float in front of the MDI parent instead of
            > being contained within it.
            >
            > --
            >
            > (O)enone
            >[/color]


            Comment

            • philip

              #7
              Re: Basic question

              Yes, it is 'Me.Size'.
              Thank you for your interest.

              Philip


              "Armin Zingler" <az.nospam@free net.de> a écrit dans le message de news:
              Ouxnx6pPGHA.515 2@TK2MSFTNGP10. phx.gbl...[color=blue]
              > "philip" <phil@philippe. com> schrieb[color=green]
              >> If the main window of my application is maximized, all the windows
              >> call by program (it is not a mdi application) open themselves
              >> maximized.
              >> The window called by the main window has this code for its Load
              >> event :
              >>
              >>
              >> Private Sub ShowOneImage_Lo ad(ByVal sender As System.Object, ByVal e
              >> As System.EventArg s) Handles MyBase.Load
              >> Me.BackgroundIm age = ImageFromFile(" xxx.jpg")
              >> Form1.Size = New System.Drawing. Size(Me.Backgro undImage.Width,
              >> Me.BackgroundIm age.Height)[/color]
              >
              > Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
              >[color=green]
              >> Me.Height = Me.BackgroundIm age.Size.Height
              >> Me.Width = Me.BackgroundIm age.Size.Width
              >> End sub[/color]
              >
              >
              > Armin[/color]


              Comment

              • Cor Ligthert [MVP]

                #8
                Re: Basic question

                Philip,

                I think that if you answer the reply from Armin it is much easier to answer.

                Cor

                "philip" <phil@philippe. com> schreef in bericht
                news:44082a51$0 $20183$8fcfb975 @news.wanadoo.f r...[color=blue]
                > BUT my application is not a MDI application...
                >
                > Thanks for your attention
                >
                >
                > "Oenone" <oenone@nowhere .com> a écrit dans le message de news:
                > 8MKNf.56316$494 .28953@newsfe2-gui.ntli.net...[color=green]
                >> philip wrote:[color=darkred]
                >>> Which property of the called window must I change to avoid this
                >>> problem ?[/color]
                >>
                >> I don't think you can change this.
                >>
                >> The behaviour of MDI child forms is that they are either all maximized or
                >> none of them are. As soon as one of your child forms maximizes, so do all
                >> the others. You'll see this in any MDI application you can find without
                >> exception (to the best of my knowledge).
                >>
                >> The only way you can stop this is to have some of your forms set as
                >> non-MDI-child forms, but of course the behaviour of the windows will be
                >> different then as they will float in front of the MDI parent instead of
                >> being contained within it.
                >>
                >> --
                >>
                >> (O)enone
                >>[/color]
                >
                >[/color]


                Comment

                • philip

                  #9
                  Re: Basic question

                  I changes my way.
                  Now, I set the property of the called window in the calling window.
                  Here is the code :

                  ShowOneImage.Wi ndowState = FormWindowState .Normal
                  ShowOneImage.Sh ow()
                  ShowOneImage.Wi ndowState = FormWindowState .Normal
                  ShowOneImage.Ba ckgroundImage = ImageFromFile ("XXX.Jpg")
                  ShowOneImage.Au toScaleMode = Windows.Forms.A utoScaleMode.No ne
                  ShowOneImage.Si ze = New
                  System.Drawing. Size(ShowOneIma ge.BackgroundIm age.Width,
                  ShowOneImage.Ba ckgroundImage.H eight)
                  ShowOneImage.He ight = ShowOneImage.Ba ckgroundImage.S ize.Height
                  ShowOneImage.Wi dth = ShowOneImage.Ba ckgroundImage.S ize.Width
                  ShowOneImage.Te xt = Me.Titre_origin alTextBox.Text

                  As you can see, I take all precautions, setting twice
                  'FormWindowStat e.Normal', before and after the opening of called window.
                  I have always the same problem. If the calling window is maximized, the
                  called window is maximized.

                  But, curious, that doesn't happen in debug mode.
                  Only if I launch the rebuilded '.exe' file of the application...
                  I don't know what I must do...

                  Thanks for interesting yourself to my problem.

                  Philip




                  "Martin" <x@y.com> a écrit dans le message de news:
                  Ol5vXRlPGHA.495 6@TK2MSFTNGP09. phx.gbl...[color=blue]
                  > Explicitly set the windowstate property of the called window to normal in
                  > its own load event.
                  > That should do the trick.
                  >
                  > "philip" <phil@philippe. com> wrote in message
                  > news:440768bf$0 $18326$8fcfb975 @news.wanadoo.f r...[color=green]
                  >> If the main window of my application is maximized, all the windows call
                  >> by program (it is not a mdi application) open themselves maximized.
                  >> The window called by the main window has this code for its Load event :
                  >>
                  >>
                  >> Private Sub ShowOneImage_Lo ad(ByVal sender As System.Object, ByVal e As
                  >> System.EventArg s) Handles MyBase.Load
                  >> Me.BackgroundIm age = ImageFromFile(" xxx.jpg")
                  >> Form1.Size = New System.Drawing. Size(Me.Backgro undImage.Width,
                  >> Me.BackgroundIm age.Height)
                  >> Me.Height = Me.BackgroundIm age.Size.Height
                  >> Me.Width = Me.BackgroundIm age.Size.Width
                  >> End sub
                  >>
                  >> In spite of this code, if the calling window is maximized, the called
                  >> window is maximized.
                  >>
                  >> If the main window is not maximized, then all is good.
                  >>
                  >> Which property of the called window must I change to avoid this problem ?
                  >>
                  >> Thanks for response.
                  >>
                  >>
                  >>
                  >>[/color]
                  >
                  >[/color]


                  Comment

                  • Cor Ligthert [MVP]

                    #10
                    Re: Basic question

                    Philip,

                    Ok then

                    Have a look at this, where in the given sample needs to be of course
                    formwindowstate .normal

                    http://msdn.microsoft.com/library/de...statetopic.asp

                    I hope this helps,

                    Cor

                    "philip" <phil@philippe. com> schreef in bericht
                    news:4408304d$0 $19681$8fcfb975 @news.wanadoo.f r...[color=blue]
                    > Yes, it is 'Me.Size'.
                    > Thank you for your interest.
                    >
                    > Philip
                    >
                    >
                    > "Armin Zingler" <az.nospam@free net.de> a écrit dans le message de news:
                    > Ouxnx6pPGHA.515 2@TK2MSFTNGP10. phx.gbl...[color=green]
                    >> "philip" <phil@philippe. com> schrieb[color=darkred]
                    >>> If the main window of my application is maximized, all the windows
                    >>> call by program (it is not a mdi application) open themselves
                    >>> maximized.
                    >>> The window called by the main window has this code for its Load
                    >>> event :
                    >>>
                    >>>
                    >>> Private Sub ShowOneImage_Lo ad(ByVal sender As System.Object, ByVal e
                    >>> As System.EventArg s) Handles MyBase.Load
                    >>> Me.BackgroundIm age = ImageFromFile(" xxx.jpg")
                    >>> Form1.Size = New System.Drawing. Size(Me.Backgro undImage.Width,
                    >>> Me.BackgroundIm age.Height)[/color]
                    >>
                    >> Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
                    >>[color=darkred]
                    >>> Me.Height = Me.BackgroundIm age.Size.Height
                    >>> Me.Width = Me.BackgroundIm age.Size.Width
                    >>> End sub[/color]
                    >>
                    >>
                    >> Armin[/color]
                    >
                    >[/color]


                    Comment

                    • Armin Zingler

                      #11
                      Re: Basic question

                      "philip" <phil@philippe. com> schrieb[color=blue]
                      > I changes my way.
                      > Now, I set the property of the called window in the calling window.
                      > Here is the code :
                      >
                      > ShowOneImage.Wi ndowState = FormWindowState .Normal
                      > ShowOneImage.Sh ow()
                      > ShowOneImage.Wi ndowState = FormWindowState .Normal
                      > ShowOneImage.Ba ckgroundImage = ImageFromFile ("XXX.Jpg")
                      > ShowOneImage.Au toScaleMode = Windows.Forms.A utoScaleMode.No ne
                      > ShowOneImage.Si ze = New
                      > System.Drawing. Size(ShowOneIma ge.BackgroundIm age.Width,
                      > ShowOneImage.Ba ckgroundImage.H eight)
                      > ShowOneImage.He ight =
                      > ShowOneImage.Ba ckgroundImage.S ize.Height ShowOneImage.Wi dth =
                      > ShowOneImage.Ba ckgroundImage.S ize.Width ShowOneImage.Te xt =
                      > Me.Titre_origin alTextBox.Text
                      >
                      > As you can see, I take all precautions, setting twice
                      > 'FormWindowStat e.Normal', before and after the opening of called
                      > window. I have always the same problem. If the calling window is
                      > maximized, the called window is maximized.
                      >
                      > But, curious, that doesn't happen in debug mode.
                      > Only if I launch the rebuilded '.exe' file of the application... I
                      > don't know what I must do...
                      >
                      > Thanks for interesting yourself to my problem.[/color]


                      What's the value of the Startposition property? Should be "Manual", I guess.

                      Armin

                      Comment

                      • philip

                        #12
                        Re: Basic question

                        For me, there is a problem.
                        Try this :
                        Create a form, on which you add a Button1.
                        Copy the following code :

                        Public Class Form11
                        Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
                        System.EventArg s) Handles Button1.Click
                        Dim bottomForm As New Form()
                        Dim topMostForm As New Form()
                        ' Set the size of the form larger than the default size.
                        topMostForm.Siz e = New Size(300, 300)
                        ' Set the position of the top most form to center of screen.
                        topMostForm.Sta rtPosition = FormStartPositi on.CenterScreen
                        ' Display the form as top most form.
                        topMostForm.Top Most = True
                        topMostForm.Win dowState = FormWindowState .Normal
                        topMostForm.Sho w()
                        End Sub
                        End Class

                        Launch by Menu 'Debug/Start debugging'
                        All is good. The starting window can be maximized or normal, no problem the
                        second window appears 'FormWindowStat e.Normal'.

                        But now, launch menu 'Build/Rebuild' and launch the '.exe' program build in
                        '\bin\release' directory of the application.
                        Maximize the first window. Click on button1 : the TopMostForm appears
                        'Maximized'.
                        If you launch the 'exe' file another time and you minimize the first window
                        at the beginning of program, before you click on Button1, then the
                        TopMostForm appears 'Normal', in its asked (300,300) size

                        Personnally, other problem, when I launch the program, the first window
                        appears ALWAYS 'Maximized'.
                        I am obliged to give 'False' to the 'MaximizeBox' property. That avoid the
                        maximization of the main window using the '.exe' file. But it's not
                        interesting...

                        Thanks for your interest, sincerely.

                        Philip

                        "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> a écrit dans le message de
                        news: %23rPjB1rPGHA.5 464@TK2MSFTNGP1 1.phx.gbl...[color=blue]
                        > Philip,
                        >
                        > Ok then
                        >
                        > Have a look at this, where in the given sample needs to be of course
                        > formwindowstate .normal
                        >
                        > http://msdn.microsoft.com/library/de...statetopic.asp
                        >
                        > I hope this helps,
                        >
                        > Cor
                        >
                        > "philip" <phil@philippe. com> schreef in bericht
                        > news:4408304d$0 $19681$8fcfb975 @news.wanadoo.f r...[color=green]
                        >> Yes, it is 'Me.Size'.
                        >> Thank you for your interest.
                        >>
                        >> Philip
                        >>
                        >>
                        >> "Armin Zingler" <az.nospam@free net.de> a écrit dans le message de news:
                        >> Ouxnx6pPGHA.515 2@TK2MSFTNGP10. phx.gbl...[color=darkred]
                        >>> "philip" <phil@philippe. com> schrieb
                        >>>> If the main window of my application is maximized, all the windows
                        >>>> call by program (it is not a mdi application) open themselves
                        >>>> maximized.
                        >>>> The window called by the main window has this code for its Load
                        >>>> event :
                        >>>>
                        >>>>
                        >>>> Private Sub ShowOneImage_Lo ad(ByVal sender As System.Object, ByVal e
                        >>>> As System.EventArg s) Handles MyBase.Load
                        >>>> Me.BackgroundIm age = ImageFromFile(" xxx.jpg")
                        >>>> Form1.Size = New System.Drawing. Size(Me.Backgro undImage.Width,
                        >>>> Me.BackgroundIm age.Height)
                        >>>
                        >>> Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
                        >>>
                        >>>> Me.Height = Me.BackgroundIm age.Size.Height
                        >>>> Me.Width = Me.BackgroundIm age.Size.Width
                        >>>> End sub
                        >>>
                        >>>
                        >>> Armin[/color]
                        >>
                        >>[/color]
                        >
                        >[/color]



                        Comment

                        • philip

                          #13
                          Re: Basic question

                          I had not seen your response.

                          StartPosition is on 'WindowsDefault Location'

                          Thanks for listening to me




                          "Armin Zingler" <az.nospam@free net.de> a écrit dans le message de news:
                          OiuoO6rPGHA.388 8@TK2MSFTNGP12. phx.gbl...[color=blue]
                          > "philip" <phil@philippe. com> schrieb[color=green]
                          >> I changes my way.
                          >> Now, I set the property of the called window in the calling window.
                          >> Here is the code :
                          >>
                          >> ShowOneImage.Wi ndowState = FormWindowState .Normal
                          >> ShowOneImage.Sh ow()
                          >> ShowOneImage.Wi ndowState = FormWindowState .Normal
                          >> ShowOneImage.Ba ckgroundImage = ImageFromFile ("XXX.Jpg")
                          >> ShowOneImage.Au toScaleMode = Windows.Forms.A utoScaleMode.No ne
                          >> ShowOneImage.Si ze = New
                          >> System.Drawing. Size(ShowOneIma ge.BackgroundIm age.Width,
                          >> ShowOneImage.Ba ckgroundImage.H eight)
                          >> ShowOneImage.He ight =
                          >> ShowOneImage.Ba ckgroundImage.S ize.Height ShowOneImage.Wi dth =
                          >> ShowOneImage.Ba ckgroundImage.S ize.Width ShowOneImage.Te xt =
                          >> Me.Titre_origin alTextBox.Text
                          >>
                          >> As you can see, I take all precautions, setting twice
                          >> 'FormWindowStat e.Normal', before and after the opening of called
                          >> window. I have always the same problem. If the calling window is
                          >> maximized, the called window is maximized.
                          >>
                          >> But, curious, that doesn't happen in debug mode.
                          >> Only if I launch the rebuilded '.exe' file of the application... I
                          >> don't know what I must do...
                          >>
                          >> Thanks for interesting yourself to my problem.[/color]
                          >
                          >
                          > What's the value of the Startposition property? Should be "Manual", I
                          > guess.
                          >
                          > Armin
                          >[/color]


                          Comment

                          • Cor Ligthert [MVP]

                            #14
                            Re: Basic question

                            Philip,

                            How can this code affect the first form, did you not set by accident in the
                            form designer properties to start it as maximised form.

                            You will not be the first.

                            I hope this helps,

                            Cor

                            "philip" <phil@philippe. com> schreef in bericht
                            news:4408911e$0 $20179$8fcfb975 @news.wanadoo.f r...[color=blue]
                            > For me, there is a problem.
                            > Try this :
                            > Create a form, on which you add a Button1.
                            > Copy the following code :
                            >
                            > Public Class Form11
                            > Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
                            > System.EventArg s) Handles Button1.Click
                            > Dim bottomForm As New Form()
                            > Dim topMostForm As New Form()
                            > ' Set the size of the form larger than the default size.
                            > topMostForm.Siz e = New Size(300, 300)
                            > ' Set the position of the top most form to center of screen.
                            > topMostForm.Sta rtPosition = FormStartPositi on.CenterScreen
                            > ' Display the form as top most form.
                            > topMostForm.Top Most = True
                            > topMostForm.Win dowState = FormWindowState .Normal
                            > topMostForm.Sho w()
                            > End Sub
                            > End Class
                            >
                            > Launch by Menu 'Debug/Start debugging'
                            > All is good. The starting window can be maximized or normal, no problem
                            > the second window appears 'FormWindowStat e.Normal'.
                            >
                            > But now, launch menu 'Build/Rebuild' and launch the '.exe' program build
                            > in '\bin\release' directory of the application.
                            > Maximize the first window. Click on button1 : the TopMostForm appears
                            > 'Maximized'.
                            > If you launch the 'exe' file another time and you minimize the first
                            > window at the beginning of program, before you click on Button1, then the
                            > TopMostForm appears 'Normal', in its asked (300,300) size
                            >
                            > Personnally, other problem, when I launch the program, the first window
                            > appears ALWAYS 'Maximized'.
                            > I am obliged to give 'False' to the 'MaximizeBox' property. That avoid the
                            > maximization of the main window using the '.exe' file. But it's not
                            > interesting...
                            >
                            > Thanks for your interest, sincerely.
                            >
                            > Philip
                            >
                            > "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> a écrit dans le message de
                            > news: %23rPjB1rPGHA.5 464@TK2MSFTNGP1 1.phx.gbl...[color=green]
                            >> Philip,
                            >>
                            >> Ok then
                            >>
                            >> Have a look at this, where in the given sample needs to be of course
                            >> formwindowstate .normal
                            >>
                            >> http://msdn.microsoft.com/library/de...statetopic.asp
                            >>
                            >> I hope this helps,
                            >>
                            >> Cor
                            >>
                            >> "philip" <phil@philippe. com> schreef in bericht
                            >> news:4408304d$0 $19681$8fcfb975 @news.wanadoo.f r...[color=darkred]
                            >>> Yes, it is 'Me.Size'.
                            >>> Thank you for your interest.
                            >>>
                            >>> Philip
                            >>>
                            >>>
                            >>> "Armin Zingler" <az.nospam@free net.de> a écrit dans le message de news:
                            >>> Ouxnx6pPGHA.515 2@TK2MSFTNGP10. phx.gbl...
                            >>>> "philip" <phil@philippe. com> schrieb
                            >>>>> If the main window of my application is maximized, all the windows
                            >>>>> call by program (it is not a mdi application) open themselves
                            >>>>> maximized.
                            >>>>> The window called by the main window has this code for its Load
                            >>>>> event :
                            >>>>>
                            >>>>>
                            >>>>> Private Sub ShowOneImage_Lo ad(ByVal sender As System.Object, ByVal e
                            >>>>> As System.EventArg s) Handles MyBase.Load
                            >>>>> Me.BackgroundIm age = ImageFromFile(" xxx.jpg")
                            >>>>> Form1.Size = New System.Drawing. Size(Me.Backgro undImage.Width,
                            >>>>> Me.BackgroundIm age.Height)
                            >>>>
                            >>>> Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
                            >>>>
                            >>>>> Me.Height = Me.BackgroundIm age.Size.Height
                            >>>>> Me.Width = Me.BackgroundIm age.Size.Width
                            >>>>> End sub
                            >>>>
                            >>>>
                            >>>> Armin
                            >>>
                            >>>[/color]
                            >>
                            >>[/color]
                            >
                            >
                            >[/color]


                            Comment

                            • Armin Zingler

                              #15
                              Re: Basic question

                              "philip" <phil@philippe. com> schrieb[color=blue]
                              > For me, there is a problem.
                              > Try this :
                              > Create a form, on which you add a Button1.
                              > Copy the following code :
                              >
                              > Public Class Form11
                              > Private Sub Button1_Click(B yVal sender As System.Object, ByVal e
                              > As System.EventArg s) Handles Button1.Click
                              > Dim bottomForm As New Form()
                              > Dim topMostForm As New Form()
                              > ' Set the size of the form larger than the default size.
                              > topMostForm.Siz e = New Size(300, 300)
                              > ' Set the position of the top most form to center of screen.
                              > topMostForm.Sta rtPosition = FormStartPositi on.CenterScreen
                              > ' Display the form as top most form.
                              > topMostForm.Top Most = True
                              > topMostForm.Win dowState = FormWindowState .Normal
                              > topMostForm.Sho w()
                              > End Sub
                              > End Class
                              >
                              > Launch by Menu 'Debug/Start debugging'
                              > All is good. The starting window can be maximized or normal, no
                              > problem the second window appears 'FormWindowStat e.Normal'.
                              >
                              > But now, launch menu 'Build/Rebuild' and launch the '.exe' program
                              > build in '\bin\release' directory of the application.
                              > Maximize the first window. Click on button1 : the TopMostForm
                              > appears 'Maximized'.[/color]


                              I can not reproduce this. It appears Normal, not Maximized.

                              Can you send me a small zipped(!) sample project? Insert a "_" between "no"
                              and "spam" in my email address.


                              Armin

                              Comment

                              Working...