Lost focus on form Resize event

S

Sumit

Hi all,

I have an MDI form in which i open some other forms.

I dont want the Control Box (having minimize, restore/maximize and
close button)
Even though I have set the controlbox property of my child forms as
false & the respective minimize & maximize box property to false, i get
the control box with restore button as enabled (when i dock my child
form in the MDI form with dockstyle as fill) which restores the
position on my child form which i need always in maximized state.

So in order to prevent the rerstoring of the window, in the form's
resize event i have written the following code:

this.WindowState = FormWindowState.Maximized;
this.ControlBox = false;

Due to this the control box doesnt appear :)
But now the focus has shifted from my application to somewhere else.
i.e the title bar of my application is not highlited.
If i click anywhere in my application it becomes highlited.

If i remove the code from the resize event the focus remains on the
tittle bar but the control box re-appears.

Kindly Help !!!!

Warm Regards
Sumit
 
O

Ollie Riches

Have you had a look at the form property 'FormBorderStyle'. It has several
options and there are several that won't display a minimize,
maximize\restore buttons.

HTH

Ollie Riches
 

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

Similar Threads

Form lost focus 1
Hide MDI Client ControlBox 1
Force UserControl to activate last active control 7
Modal Form from a child form 2
Resize event 1
MDI Child 3
Focusing a TextBox 4
Automatically Resize Form? 8

Top