PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: ? on killfocus & buttons  (Read 377 times)

Paul D. Elliott

  • Guest
? on killfocus & buttons
« on: February 28, 2006, 06:35:20 PM »

In the project that I'm working on, I've got a combo-box killfocus routine
that I check to make sure that there is a valid entry before I allow the
user to go to the next field. However there are a couple instances where
I need to allow the user to press 1 of 2 buttons to bypass the validation.

Is there a way, in the killfocus of the combo-box, to know if a button has
been clicked? I'm pretty sure that I need the killfocus because other
controls need updated depending on the contents of the combo-box
before the user has a chance to click on some other control ( they don't
always listen when I say to follow the natural order of the controls on the
screen ... some of them just have to be contrary ). I've looked thru
POFFS but wasn't able to find a solution.

Thanks.
Logged

TechSupport

  • Guest
Re: ? on killfocus & buttons
« Reply #1 on: February 28, 2006, 08:14:19 PM »

Quote from: "Paul D. Elliott"
Is there a way, in the killfocus of the combo-box, to know if a button has been clicked?

If I am reading this correctly then it would be impossible because if the user goes to click on another button then the killfocus of the combobox would fire. So even if you set some sort of flag in the BN_CLICKED of your buttons then I doubt that the combobox will get a chance to test for the flag condition.

See what I mean? ..... or am I missing the point. Also, I haven't testing this but I expect placing a MsgBox in the killfocus of the combobox should should that it fires prior to the BN_CLICKED.
Logged

Paul D. Elliott

  • Guest
? on killfocus & buttons
« Reply #2 on: March 01, 2006, 01:08:23 PM »

No, you got it right.

I am converting a Delphi program over to PB. I was
hoping to enhance a couple areas. In the Delphi program, when I exited
this combo-box, if they had entered something not in the list I just
skipped updating the related fields and kept on going. I thought it would
be good if I could take them back to the combo-box until they picked
a good entry. But had to leave them a way out ( 2 actually - exit the
screen entirely or look up via another table ).  As it is working okay so
far ( no major complaints ), I'll just keep it as is.

Thanks.
Logged

Paul D. Elliott

  • Guest
? on killfocus & buttons
« Reply #3 on: March 06, 2006, 02:34:22 PM »

AHA, found it!

GetFocus returns the handle of the window ( or control ) that currently
has the focus. All I have to do is compare that to the handles of the 2
buttons and I can do what I wanted to do.  Another enhancement done.
Now back to the rest of the nitpicking details.
Logged