Get focus on a form

W

Wan

Hi,
I have a small test project consists of two simple forms. The main
form contains a datagrid and upon doubleclick event of grid I bring up
a detail form that contains few controls, drop-down, textboxes &
button. if I double click the second time, detail form shows up again
- so far so good. Here is the problem - if I go back to the first
instance of detail form and try to click on add button then the focus
goes back to second instance of detail form. I would like to open
multiple instances of detail form for data comparison purposes. Is it
possible to keep the focus on the same selected form?

-- double click event
Dim frmD as new frmDetail
frmD.show
 
R

Ryan S. Thiele

You can tell your app to focus on the first instance.

MyControl.Focus(MyFirstInstanceControl)

Or if you dynamically add the controls...

MyControl.Focus(MyControl.Controls(0))

Hope this helps.
 

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