Home All Groups Group Topic Archive Search About
Author
2 Mar 2006 9:50 PM
philip
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_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
    Me.BackgroundImage = ImageFromFile("xxx.jpg")
    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
Me.BackgroundImage.Height)
    Me.Height = Me.BackgroundImage.Size.Height
    Me.Width = Me.BackgroundImage.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.

Author
2 Mar 2006 10:58 PM
Oenone
philip wrote:
> Which property of the called window must I change to avoid this
> problem ?

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
Author
3 Mar 2006 11:36 AM
philip
BUT my application is not a MDI application...

Thanks for your attention


"Oenone" <oen***@nowhere.com> a écrit dans le message de news:
8MKNf.56316$494.28***@newsfe2-gui.ntli.net...
Show quoteHide quote
> philip wrote:
>> Which property of the called window must I change to avoid this
>> problem ?
>
> 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
>
Author
3 Mar 2006 12:05 PM
Cor Ligthert [MVP]
Philip,

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

Cor

Show quoteHide quote
"philip" <p***@philippe.com> schreef in bericht
news:44082a51$0$20183$8fcfb975@news.wanadoo.fr...
> BUT my application is not a MDI application...
>
> Thanks for your attention
>
>
> "Oenone" <oen***@nowhere.com> a écrit dans le message de news:
> 8MKNf.56316$494.28***@newsfe2-gui.ntli.net...
>> philip wrote:
>>> Which property of the called window must I change to avoid this
>>> problem ?
>>
>> 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
>>
>
>
Author
2 Mar 2006 11:08 PM
Armin Zingler
"philip" <p***@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_Load(ByVal sender As System.Object, ByVal e
> As System.EventArgs) Handles MyBase.Load
>    Me.BackgroundImage = ImageFromFile("xxx.jpg")
>    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
> Me.BackgroundImage.Height)

Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?

>    Me.Height = Me.BackgroundImage.Size.Height
>    Me.Width = Me.BackgroundImage.Size.Width
> End sub


Armin
Author
3 Mar 2006 12:02 PM
philip
Yes, it is 'Me.Size'.
Thank you for your interest.

Philip


"Armin Zingler" <az.nospam@freenet.de> a écrit dans le message de news:
Ouxnx6pPGHA.5***@TK2MSFTNGP10.phx.gbl...
Show quoteHide quote
> "philip" <p***@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_Load(ByVal sender As System.Object, ByVal e
>> As System.EventArgs) Handles MyBase.Load
>>    Me.BackgroundImage = ImageFromFile("xxx.jpg")
>>    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
>> Me.BackgroundImage.Height)
>
> Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
>
>>    Me.Height = Me.BackgroundImage.Size.Height
>>    Me.Width = Me.BackgroundImage.Size.Width
>> End sub
>
>
> Armin
Author
3 Mar 2006 12:24 PM
Cor Ligthert [MVP]
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/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsformclasswindowstatetopic.asp

I hope this helps,

Cor

Show quoteHide quote
"philip" <p***@philippe.com> schreef in bericht
news:4408304d$0$19681$8fcfb975@news.wanadoo.fr...
> Yes, it is 'Me.Size'.
> Thank you for your interest.
>
> Philip
>
>
> "Armin Zingler" <az.nospam@freenet.de> a écrit dans le message de news:
> Ouxnx6pPGHA.5***@TK2MSFTNGP10.phx.gbl...
>> "philip" <p***@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_Load(ByVal sender As System.Object, ByVal e
>>> As System.EventArgs) Handles MyBase.Load
>>>    Me.BackgroundImage = ImageFromFile("xxx.jpg")
>>>    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
>>> Me.BackgroundImage.Height)
>>
>> Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
>>
>>>    Me.Height = Me.BackgroundImage.Size.Height
>>>    Me.Width = Me.BackgroundImage.Size.Width
>>> End sub
>>
>>
>> Armin
>
>
Author
3 Mar 2006 6:55 PM
philip
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(ByVal sender As System.Object, ByVal e As
System.EventArgs) 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.Size = New Size(300, 300)
        ' Set the position of the top most form to center of screen.
        topMostForm.StartPosition = FormStartPosition.CenterScreen
        ' Display the form as top most form.
        topMostForm.TopMost = True
        topMostForm.WindowState = FormWindowState.Normal
        topMostForm.Show()
    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 'FormWindowState.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]" <notmyfirstn***@planet.nl> a écrit dans le message de
news: %23rPjB1rPGHA.5***@TK2MSFTNGP11.phx.gbl...
Show quoteHide quote
> 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/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsformclasswindowstatetopic.asp
>
> I hope this helps,
>
> Cor
>
> "philip" <p***@philippe.com> schreef in bericht
> news:4408304d$0$19681$8fcfb975@news.wanadoo.fr...
>> Yes, it is 'Me.Size'.
>> Thank you for your interest.
>>
>> Philip
>>
>>
>> "Armin Zingler" <az.nospam@freenet.de> a écrit dans le message de news:
>> Ouxnx6pPGHA.5***@TK2MSFTNGP10.phx.gbl...
>>> "philip" <p***@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_Load(ByVal sender As System.Object, ByVal e
>>>> As System.EventArgs) Handles MyBase.Load
>>>>    Me.BackgroundImage = ImageFromFile("xxx.jpg")
>>>>    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
>>>> Me.BackgroundImage.Height)
>>>
>>> Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
>>>
>>>>    Me.Height = Me.BackgroundImage.Size.Height
>>>>    Me.Width = Me.BackgroundImage.Size.Width
>>>> End sub
>>>
>>>
>>> Armin
>>
>>
>
>
Author
4 Mar 2006 6:21 AM
Cor Ligthert [MVP]
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

Show quoteHide quote
"philip" <p***@philippe.com> schreef in bericht
news:4408911e$0$20179$8fcfb975@news.wanadoo.fr...
> 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(ByVal sender As System.Object, ByVal e As
> System.EventArgs) 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.Size = New Size(300, 300)
>        ' Set the position of the top most form to center of screen.
>        topMostForm.StartPosition = FormStartPosition.CenterScreen
>        ' Display the form as top most form.
>        topMostForm.TopMost = True
>        topMostForm.WindowState = FormWindowState.Normal
>        topMostForm.Show()
>    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 'FormWindowState.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]" <notmyfirstn***@planet.nl> a écrit dans le message de
> news: %23rPjB1rPGHA.5***@TK2MSFTNGP11.phx.gbl...
>> 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/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsformclasswindowstatetopic.asp
>>
>> I hope this helps,
>>
>> Cor
>>
>> "philip" <p***@philippe.com> schreef in bericht
>> news:4408304d$0$19681$8fcfb975@news.wanadoo.fr...
>>> Yes, it is 'Me.Size'.
>>> Thank you for your interest.
>>>
>>> Philip
>>>
>>>
>>> "Armin Zingler" <az.nospam@freenet.de> a écrit dans le message de news:
>>> Ouxnx6pPGHA.5***@TK2MSFTNGP10.phx.gbl...
>>>> "philip" <p***@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_Load(ByVal sender As System.Object, ByVal e
>>>>> As System.EventArgs) Handles MyBase.Load
>>>>>    Me.BackgroundImage = ImageFromFile("xxx.jpg")
>>>>>    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
>>>>> Me.BackgroundImage.Height)
>>>>
>>>> Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
>>>>
>>>>>    Me.Height = Me.BackgroundImage.Size.Height
>>>>>    Me.Width = Me.BackgroundImage.Size.Width
>>>>> End sub
>>>>
>>>>
>>>> Armin
>>>
>>>
>>
>>
>
>
>
Author
4 Mar 2006 2:39 PM
philip
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]" <notmyfirstn***@planet.nl> a écrit dans le message de
news: uuY0sO1PGHA.2***@TK2MSFTNGP09.phx.gbl...
Show quoteHide quote
> 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" <p***@philippe.com> schreef in bericht
> news:4408911e$0$20179$8fcfb975@news.wanadoo.fr...
>> 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(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) 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.Size = New Size(300, 300)
>>        ' Set the position of the top most form to center of screen.
>>        topMostForm.StartPosition = FormStartPosition.CenterScreen
>>        ' Display the form as top most form.
>>        topMostForm.TopMost = True
>>        topMostForm.WindowState = FormWindowState.Normal
>>        topMostForm.Show()
>>    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 'FormWindowState.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]" <notmyfirstn***@planet.nl> a écrit dans le message
>> de
>> news: %23rPjB1rPGHA.5***@TK2MSFTNGP11.phx.gbl...
>>> 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/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsformclasswindowstatetopic.asp
>>>
>>> I hope this helps,
>>>
>>> Cor
>>>
>>> "philip" <p***@philippe.com> schreef in bericht
>>> news:4408304d$0$19681$8fcfb975@news.wanadoo.fr...
>>>> Yes, it is 'Me.Size'.
>>>> Thank you for your interest.
>>>>
>>>> Philip
>>>>
>>>>
>>>> "Armin Zingler" <az.nospam@freenet.de> a écrit dans le message de news:
>>>> Ouxnx6pPGHA.5***@TK2MSFTNGP10.phx.gbl...
>>>>> "philip" <p***@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_Load(ByVal sender As System.Object, ByVal e
>>>>>> As System.EventArgs) Handles MyBase.Load
>>>>>>    Me.BackgroundImage = ImageFromFile("xxx.jpg")
>>>>>>    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
>>>>>> Me.BackgroundImage.Height)
>>>>>
>>>>> Where did you declare "Form1"? Shouldn't this be "Me.size = ..."?
>>>>>
>>>>>>    Me.Height = Me.BackgroundImage.Size.Height
>>>>>>    Me.Width = Me.BackgroundImage.Size.Width
>>>>>> End sub
>>>>>
>>>>>
>>>>> Armin
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>
Author
4 Mar 2006 3:25 PM
Armin Zingler
"philip" <p***@philippe.com> schrieb
> I send an zipped sample of the app to Armin Zingler to show the
> problem (he asked me to do that)


....and Armin answered:

"I can not reproduce the problem. I do it exactly as you described. Neither
the 1st nor the 2nd window is ever opened maximized."


Armin
Author
4 Mar 2006 11:16 AM
Armin Zingler
Show quote Hide quote
"philip" <p***@philippe.com> schrieb
> 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(ByVal sender As System.Object, ByVal e
> As System.EventArgs) 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.Size = New Size(300, 300)
>        ' Set the position of the top most form to center of screen.
> topMostForm.StartPosition = FormStartPosition.CenterScreen
>        ' Display the form as top most form.
>        topMostForm.TopMost = True
>        topMostForm.WindowState = FormWindowState.Normal
>        topMostForm.Show()
>    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 'FormWindowState.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'.


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
Author
5 Mar 2006 1:31 AM
philip
Is it possible that is a problem of my computer, which has an RADEON X800
GTO card, with two screens ?
Is it interressing to look at the options of the driver ?

Thanks for response

Philip

"Armin Zingler" <az.nospam@freenet.de> a écrit dans le message de news:
%23$IDm03PGHA.***@TK2MSFTNGP12.phx.gbl...
Show quoteHide quote
> "philip" <p***@philippe.com> schrieb
>> 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(ByVal sender As System.Object, ByVal e
>> As System.EventArgs) 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.Size = New Size(300, 300)
>>        ' Set the position of the top most form to center of screen.
>> topMostForm.StartPosition = FormStartPosition.CenterScreen
>>        ' Display the form as top most form.
>>        topMostForm.TopMost = True
>>        topMostForm.WindowState = FormWindowState.Normal
>>        topMostForm.Show()
>>    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 'FormWindowState.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'.
>
>
> 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
>
Author
2 Mar 2006 11:51 PM
Martin
Explicitly set the windowstate property of the called window to normal in
its own load event.
That should do the trick.

Show quoteHide quote
"philip" <p***@philippe.com> wrote in message
news:440768bf$0$18326$8fcfb975@news.wanadoo.fr...
> 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_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>    Me.BackgroundImage = ImageFromFile("xxx.jpg")
>    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
> Me.BackgroundImage.Height)
>    Me.Height = Me.BackgroundImage.Size.Height
>    Me.Width = Me.BackgroundImage.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.
>
>
>
>
Author
3 Mar 2006 12:12 PM
philip
I changes my way.
Now, I set the property of the called window in the calling window.
Here is the code :

        ShowOneImage.WindowState = FormWindowState.Normal
        ShowOneImage.Show()
        ShowOneImage.WindowState = FormWindowState.Normal
        ShowOneImage.BackgroundImage = ImageFromFile ("XXX.Jpg")
        ShowOneImage.AutoScaleMode = Windows.Forms.AutoScaleMode.None
        ShowOneImage.Size = New
System.Drawing.Size(ShowOneImage.BackgroundImage.Width,
ShowOneImage.BackgroundImage.Height)
        ShowOneImage.Height = ShowOneImage.BackgroundImage.Size.Height
        ShowOneImage.Width = ShowOneImage.BackgroundImage.Size.Width
        ShowOneImage.Text = Me.Titre_originalTextBox.Text

As you can see, I take all precautions, setting twice
'FormWindowState.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.4***@TK2MSFTNGP09.phx.gbl...
Show quoteHide quote
> Explicitly set the windowstate property of the called window to normal in
> its own load event.
> That should do the trick.
>
> "philip" <p***@philippe.com> wrote in message
> news:440768bf$0$18326$8fcfb975@news.wanadoo.fr...
>> 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_Load(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles MyBase.Load
>>    Me.BackgroundImage = ImageFromFile("xxx.jpg")
>>    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
>> Me.BackgroundImage.Height)
>>    Me.Height = Me.BackgroundImage.Size.Height
>>    Me.Width = Me.BackgroundImage.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.
>>
>>
>>
>>
>
>
Author
3 Mar 2006 12:31 PM
Armin Zingler
Show quote Hide quote
"philip" <p***@philippe.com> schrieb
> I changes my way.
> Now, I set the property of the called window in the calling window.
> Here is the code :
>
>        ShowOneImage.WindowState = FormWindowState.Normal
>        ShowOneImage.Show()
>        ShowOneImage.WindowState = FormWindowState.Normal
>        ShowOneImage.BackgroundImage = ImageFromFile ("XXX.Jpg")
>   ShowOneImage.AutoScaleMode = Windows.Forms.AutoScaleMode.None
>   ShowOneImage.Size = New
> System.Drawing.Size(ShowOneImage.BackgroundImage.Width,
> ShowOneImage.BackgroundImage.Height)
>        ShowOneImage.Height =
> ShowOneImage.BackgroundImage.Size.Height        ShowOneImage.Width =
> ShowOneImage.BackgroundImage.Size.Width        ShowOneImage.Text =
> Me.Titre_originalTextBox.Text
>
> As you can see, I take all precautions, setting twice
> 'FormWindowState.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.


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

Armin
Author
3 Mar 2006 8:06 PM
philip
I had not seen your response.

StartPosition is on 'WindowsDefaultLocation'

Thanks for listening to me




"Armin Zingler" <az.nospam@freenet.de> a écrit dans le message de news:
OiuoO6rPGHA.3***@TK2MSFTNGP12.phx.gbl...
Show quoteHide quote
> "philip" <p***@philippe.com> schrieb
>> I changes my way.
>> Now, I set the property of the called window in the calling window.
>> Here is the code :
>>
>>        ShowOneImage.WindowState = FormWindowState.Normal
>>        ShowOneImage.Show()
>>        ShowOneImage.WindowState = FormWindowState.Normal
>>        ShowOneImage.BackgroundImage = ImageFromFile ("XXX.Jpg")
>>   ShowOneImage.AutoScaleMode = Windows.Forms.AutoScaleMode.None
>>   ShowOneImage.Size = New
>> System.Drawing.Size(ShowOneImage.BackgroundImage.Width,
>> ShowOneImage.BackgroundImage.Height)
>>        ShowOneImage.Height =
>> ShowOneImage.BackgroundImage.Size.Height        ShowOneImage.Width =
>> ShowOneImage.BackgroundImage.Size.Width        ShowOneImage.Text =
>> Me.Titre_originalTextBox.Text
>>
>> As you can see, I take all precautions, setting twice
>> 'FormWindowState.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.
>
>
> What's the value of the Startposition property? Should be "Manual", I
> guess.
>
> Armin
>
Author
3 Mar 2006 11:08 AM
Martin
Explicitly set the windowstate property of the called window to normal in
its own load event.
That should do the trick.

Show quoteHide quote
"philip" <p***@philippe.com> wrote in message
news:440768bf$0$18326$8fcfb975@news.wanadoo.fr...
> 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_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>    Me.BackgroundImage = ImageFromFile("xxx.jpg")
>    Form1.Size = New System.Drawing.Size(Me.BackgroundImage.Width,
> Me.BackgroundImage.Height)
>    Me.Height = Me.BackgroundImage.Size.Height
>    Me.Width = Me.BackgroundImage.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.
>
>
>
>