maximise form

D

Doug Bell

Hi, I am having some difficulty getting a form to Maximise.
The form initially loads and maximises.
With no User activity it will minimise after a delay.
When the User clicks on the Task Bar the form re-appears but Normal not
Maximised.
I have the Forms WindowState property set to Maximised
I also have code in the Activate event of the form

Private Sub FormOrders_Activated(ByVal sender As Object, _

ByVal e As System.EventArgs) Handles MyBase.Activated

'Set Timer to Minimise Form

timFormActivate = Now()

TimerMin.Enabled = True

dacCheckUpdate()

'Set Window Size

WindowState = FormWindowState.Maximized

End Sub

Can someone please explain why the form does not Maximise?

Thanks

Doug
 
C

Cor Ligthert

Dough,

Probably because your dacCheckUpdate process is shorter than the timer
setting.
Than your form will be maximized and than minimized.

Try to test it with on the place of dacCheckUpdate at least a
threading.thread.sleep(a number larger than your timer uses )

I hope that this helps,

Cor
 
D

Doug Bell

Cor,
Even with the dacCheckUpdate remarked out and the timer re-enabling remarked
out it re-opens Normal.
ie it loads and opens maximised then if you minimise it and then click on
the Task Bar it re-displays Normal

dacCheckUpdate was retrieving soome data.

Thanks

Doug
 
C

Cor Ligthert

Dough,
Even with the dacCheckUpdate remarked out and the timer re-enabling
remarked
out it re-opens Normal.
ie it loads and opens maximised then if you minimise it and then click on
the Task Bar it re-displays Normal

dacCheckUpdate was retrieving soome data.

That would than mean that the only instruction in this would be
\\\
WindowState = FormWindowState.Maximized
///

Sorry, however I cannot believe that with this as last instruction the form
is showed as normal. There should be something behind that.

Cor
 
D

Doug Bell

Hi Cor,

Yes that is correct.
I played with

If WindowState <> FormWindowState.Maximized then
msgbox "State=Not Max"
WindowState = FormWindowState.Maximized

endif

And that worked OK but then I took the msgbox out and it stopped again.

Then strangely I assembled it and loaded it and it worked in its original
form but it doesn't work when in Debug.
 
D

Doug Bell

Hi Ahmed,

It is certainly similar because the other thing it does is that when the
main form loads a daughter form (dialogue) and after it closes, it covers
the task bar which will not pop up over it.
If you hit the minimise you can get to the task bar again.
Ctl Tab still alows changing windows.

But the way it is working is not normal behaviour although tolerable (but
yuck)

Doug.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top