|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Control conflictI have a form with combo box and a command button. Normally there is a
selection of some entry in the combo box and when it loses focus some validation is done. The command button triggers an abort routine that halts further processing of the form and unloads it. The problem is that initially the focus is on the combo box so that if I click on the abort command button before entering anything into the combo box the Lost focus for the combo box executes before the actions triggered by the abort button. How can I determine within the lost focus event of the combo box that it really got to there because the abort command button was clicked? Make any sense?
Show quote
Hide quote
"Melvin" <marvw***@columbus.rr.com> wrote in message set a flag when processing starts... better yet, have the abort button news:%23x374uG6JHA.3304@TK2MSFTNGP06.phx.gbl... >I have a form with combo box and a command button. Normally there is a >selection of some entry in the combo box and when it loses focus some >validation is done. The command button triggers an abort routine that >halts further processing of the form and unloads it. > > The problem is that initially the focus is on the combo box so that if I > click on the abort command button before entering anything into the combo > box the Lost focus for the combo box executes before the actions > triggered by the abort button. How can I determine within the lost focus > event of the combo box that it really got to there because the abort > command button was clicked? > > Make any sense? disabled until the actions begin and disable it again when they are done
Show quote
Hide quote
"Bob Butler" <noway@nospam.ever> wrote in message I can possibly do something with a flag. I don't want to disable the abort news:%23dH$l3G6JHA.1420@TK2MSFTNGP04.phx.gbl... > > "Melvin" <marvw***@columbus.rr.com> wrote in message > news:%23x374uG6JHA.3304@TK2MSFTNGP06.phx.gbl... >>I have a form with combo box and a command button. Normally there is a >>selection of some entry in the combo box and when it loses focus some >>validation is done. The command button triggers an abort routine that >>halts further processing of the form and unloads it. >> >> The problem is that initially the focus is on the combo box so that if I >> click on the abort command button before entering anything into the >> combo box the Lost focus for the combo box executes before the actions >> triggered by the abort button. How can I determine within the lost focus >> event of the combo box that it really got to there because the abort >> command button was clicked? >> >> Make any sense? > > set a flag when processing starts... better yet, have the abort button > disabled until the actions begin and disable it again when they are done > button as I want it active so that at any point of completing the data for the form I can abort the process. For example, suppose that I got to this form and then decided I really didn't want to use it and simply wanted to unload the form. Or, possible started selecting data with the combo box (there are several) THEN decided to abort the process by clicking on the abort button. I was hopping there was some way to bypass the lost focus procedure it the abort button was clicked. Melvin wrote:
> I was hopping there was some way to bypass the lost focus procedure it the In LostFocus, query ActiveControl. Bail if needed.> abort button was clicked. "Karl E. Peterson" <k***@exmvps.org> wrote in message Just exactly what I was looking for. Thanks much.news:%23uleXTI6JHA.4864@TK2MSFTNGP03.phx.gbl... > Melvin wrote: >> I was hopping there was some way to bypass the lost focus procedure it >> the >> abort button was clicked. > > In LostFocus, query ActiveControl. Bail if needed. > -- > .NET: It's About Trust! > http://vfred.mvps.org >
Show quote
Hide quote
"Melvin" <marvw***@columbus.rr.com> skrev i meddelandet You can maybe, in code, set the focus to another control at start.news:%23x374uG6JHA.3304@TK2MSFTNGP06.phx.gbl... >I have a form with combo box and a command button. Normally there is a >selection of some entry in the combo box and when it loses focus some >validation is done. The command button triggers an abort routine that >halts further processing of the form and unloads it. > > The problem is that initially the focus is on the combo box so that if I > click on the abort command button before entering anything into the combo > box the Lost focus for the combo box executes before the actions > triggered by the abort button. How can I determine within the lost focus > event of the combo box that it really got to there because the abort > command button was clicked? > > Make any sense? > > > > /Henning
Show quote
Hide quote
"Henning" <computer_h***@coldmail.com> wrote in message Henning, thanks for the response. There are actually a number of combo news:%23zU6cIH6JHA.6136@TK2MSFTNGP03.phx.gbl... > > "Melvin" <marvw***@columbus.rr.com> skrev i meddelandet > news:%23x374uG6JHA.3304@TK2MSFTNGP06.phx.gbl... >>I have a form with combo box and a command button. Normally there is a >>selection of some entry in the combo box and when it loses focus some >>validation is done. The command button triggers an abort routine that >>halts further processing of the form and unloads it. >> >> The problem is that initially the focus is on the combo box so that if I >> click on the abort command button before entering anything into the >> combo box the Lost focus for the combo box executes before the actions >> triggered by the abort button. How can I determine within the lost focus >> event of the combo box that it really got to there because the abort >> command button was clicked? >> >> Make any sense? >> >> >> >> > > You can maybe, in code, set the focus to another control at start. > > /Henning > > boxes and text boxes on the form that need to be filled in sequence, so I would need to make the extra step of going back at some point to the combo box out of sequence. Mel "Melvin" <marvw***@columbus.rr.com> wrote Check the ActiveControl:> How can I determine within the lost focus event of the > combo box that it really got to there because the abort command button was > clicked? Debug.Print ActiveControl.Name If the button was clicked that would be the active control. LFS
Show quote
Hide quote
"Larry Serflaten" <serfla***@usinternet.com> wrote in message Larry, you and Karl both knew just what I needed. Thanksnews:%23VMOi3H6JHA.4116@TK2MSFTNGP04.phx.gbl... > > "Melvin" <marvw***@columbus.rr.com> wrote >> How can I determine within the lost focus event of the >> combo box that it really got to there because the abort command button >> was >> clicked? > > Check the ActiveControl: > > Debug.Print ActiveControl.Name > > If the button was clicked that would be the active control. > > > LFS > >
Re: Multithreading
Multithreading Vista SP2 Being "offered" dhRichClient3 Thread Classes Issues VB6 on Vista Home Premium problem Excel Execution from VB Fails on 2nd Attempt Use an Addin to automatically add date/time stamp to each edited line of VB6 code? Sub .... or Private Sub.... Moving .exe somtimes works In High Density Mode - Looking for previous control counting post |
|||||||||||||||||||||||