![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
I have run into a problem trying to close a form. It does not happen on the desktop just on the device. if i press the button 'btnCreditCancel' this is in the sub Sub btnCreditCancel_Click Credit.Close End Sub The name of the form is Credit The form does not close. i suspect that the program flow is going back to the calling routine and then opening the form again i put a message box after the calling statement but it gets executed as soon as the form is shown not when the form is closed. Question 1 how can i find out program flow Question 2 how can i fix my problem thanks Joe Edit: i fixed the problem but it does not seem elegant. This is the sub that calls the form and as i suspected it was being executed over and over again. It must get executed as the credit form is closed. So when the calling form is receiving the focus the radio button must be having it's click event fired because it was the last item selected. Is there a way of avoiding this without having to set flags? Sub trxTypeCard_Click If CreditFormCalled=True Then CreditFormCalled=False Return End If CreditCardOk=False trxType=1 Credit.Show CreditFormCalled=True End Sub Thanks to all and any for some insight! Last edited by Smee : 03-10-2010 at 09:09 AM. Reason: partially fixed |
|
|||
|
Klaus,
This is calling sub Sub trxTypeCard_Click CreditCardOk=False trxType=1 Credit.Show End Sub this is the called form Sub Credit_Show Password="" txtPassword.Text ="" txtCardNo.Text="" End Sub Sub btnCreditCancel_Click Credit.Close End Sub Sub Credit_Close If CreditCardOk=False Then Msgbox("Credit Denied") trxType=0 trxTypeCash.Checked=True end If End Sub trxTypeCash is a radio button on the calling form Hope this helps Thanks Joe |
|
||||
|
I remembered too that there is some strange behaviour with radiobuttons.
Have a look here : Unwanted Click Event Try, in the IDE, to send back the radiobutton to ensure that it doesn't get the focus when you close form2. Best regards.
__________________
Klaus Switzerland |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Program not closing completely | derez | Questions & Help Needed | 9 | 07-28-2009 10:29 AM |
| Error when closing help - not sure if its my PC though | badkarma | Bug Reports | 1 | 03-13-2009 07:48 PM |
| Problems opening closing forms | admben25 | Questions & Help Needed | 3 | 11-03-2008 04:08 AM |
| Problem Adding panel in tabpages to multiple Forms | mozaharul | Questions & Help Needed | 2 | 04-28-2008 09:49 AM |
| Merging forms | skipper | Questions & Help Needed | 2 | 01-10-2008 12:18 PM |