Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Focus Issue

Status
Not open for further replies.

DarkConsultant

Programmer
Dec 4, 2007
156
GB
Hi All,

FormA is my main form and is always open.
FormB is a non-modal info form and is open or closed

If FormA opens modal FormC then FormC gets focus.

I have added some code into the Load event of FormC that checks to see if FormB is open (tracking boolean variable) and if it is then FormB is minimised. Now unless I click on FormC I cannot get it to have focus.

I first thought that I needed an event to fire the minimise of FormB but this made no difference so then I used
FormB.WindowState = FormWindowState.Minimised
in the load event and this made no difference.

All of the above work inasmuch as they minimise FormB but nothing will set focus on FormC including a timer on FormC whose Tick event called .Focus. Nothing.

Any ideas please?

TIA

David

DarkConsultant

Live long and prosper \\//
 
Can you show us the code from FormA that minimizes FormB and loads FormC modally?

--------------------------------------------------
“Crash programs fail because they are based on the theory that, with nine women pregnant, you can get a baby a month.” --Wernher von Braun
--------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top