user control - lost focus?

B

BrenB

I'm trying to trap for an event in my user control so that I can
manage the state of the user interface.

The control is used to enter data into a database.

The control contains a tab control with one tab containing a grid
listing records, the other tabs are display/entry fields.

The problem is how I handle adding a new record. If the user starts to
enter a new record. I disable all buttons except for a cancel button
in the control itself, but I don't disable other buttons and controls
on the form outside of the control.

I'm thinking that I could trap for the controls lost focus event in
the form, but I'm getting erratic results. The event isn't raised when
I click on another control, and sometimes it is raised when I click
back on the user control, but not always.

While I'm trying to figure out what's going on, I thought I'd ask for
help here.

Thanks, Bren
 
H

Harry

BrenB said:
I'm trying to trap for an event in my user control so that I can
manage the state of the user interface.

The control is used to enter data into a database.

The control contains a tab control with one tab containing a grid
listing records, the other tabs are display/entry fields.

The problem is how I handle adding a new record. If the user starts to
enter a new record. I disable all buttons except for a cancel button
in the control itself, but I don't disable other buttons and controls
on the form outside of the control.

I'm thinking that I could trap for the controls lost focus event in
the form, but I'm getting erratic results. The event isn't raised when
I click on another control, and sometimes it is raised when I click
back on the user control, but not always.

While I'm trying to figure out what's going on, I thought I'd ask for
help here.

Thanks, Bren

How about the controls Validate event?
 

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