Re: Basic question
I send an zipped sample of the app to Armin Zingler to show the problem (he
asked me to do that)
Thanks
Philip
"Cor Ligthert [MVP]" <notmyfirstname @planet.nl> a écrit dans le message de
news: uuY0sO1PGHA.208 0@TK2MSFTNGP09. phx.gbl...[color=blue]
> 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=green]
>> 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=darkred]
>>> 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...
>>>> 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]
I send an zipped sample of the app to Armin Zingler to show the problem (he
asked me to do that)
Thanks
Philip
"Cor Ligthert [MVP]" <notmyfirstname @planet.nl> a écrit dans le message de
news: uuY0sO1PGHA.208 0@TK2MSFTNGP09. phx.gbl...[color=blue]
> 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=green]
>> 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=darkred]
>>> 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...
>>>> 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