Sub btnCustomDialog2_click
Dim cd As CustomDialog2
[COLOR="Red"]cd.AddView(pnlNumericUpDown,160dip,50dip)[/COLOR]
cd.Show("Spielschein-Auswahl","OK","Abbrechen","",Null)
If cd.Response=-1 Then
Dim n As Int
n=txtBox.text
Msgbox(n,"Test")
'SchowSpielSchein(n - 1)
End If
End Sub
You are adding a Panel that has already been added before and so already has a parent. If you used a newly created local Panel each time there would be no problem. However in order to allow such reuse of an existing Panel Dialogs version 2.3 now internally removes the Panel on closure allowing such reuse.
I still have a problem.
Do you know why my sub "btnUpDown_LongClick" does not work?
PHP:
Sub btnUpDown_LongClick
Dim btn As Button
btn=Sender
txtBox=btn.Tag
If btn.Text="+" Then
blnNumericUpDownAdd=True
Else
blnNumericUpDownAdd=False
End If
timerNumericUpDown.Enabled = True
End Sub
Sub timerNumericUpDown_Tick
Dim lst As List
Dim n As Int
n=txtBox.Text
lst=txtBox.Tag
If blnNumericUpDownAdd Then
If n < lst.Get(1) Then n=n + 1
Else
If n > lst.Get(0) Then n=n - 1
End If
txtBox.Text = n
End Sub
Your LongClick event is working fine from within the dialog, it is the Timer event that is not firing. I think this is because the modal dialog mechanism in Basic4android will not despatch B4ARunnables while the dialog is shown. I'm not absolutely sure as I can't immediately see that the timer uses a B4ARunnable to raise the event, it looks like a normal Runnablebut it seems likely that this or something very similar is the reason.
@Erel. Is this right? TickTack looks like a normal Runnable not a B4ARunnable.
There is already a numeric updown in Dialogs, I don't see a need to add another. Your feature of automatically changing the value while pressing the button is not possible in a library for the same reason as you found.