version 5.80 1 frmDialog Form1 2 10 0 0 0 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 238 268 0 0 0 Sub designer addform(frmDialog,"Title","",255,255,255)@ addbutton(frmdialog,btn3,165,130,70,40,"",212,208,200,0,0,0,True,True,9)@ addbutton(frmdialog,btn2,85,130,70,40,"",212,208,200,0,0,0,True,True,9)@ addbutton(frmdialog,btn1,5,130,70,40,"",212,208,200,0,0,0,True,True,9)@ addlabel(frmdialog,lblText,5,10,230,110,"",255,255,255,0,0,0,True,True,9)@ addform(Form1,"Form1","",220,220,220)@ addbutton(form1,btnDialogUser,25,185,120,23,"Dialog 3 btns user",212,208,200,0,0,0,True,True,9)@ addbutton(form1,btnDialog2,25,125,120,23,"Dialog 2 btns",212,208,200,0,0,0,True,True,9)@ addbutton(form1,btnDialog3,25,155,120,23,"Dialog 3 btns",212,208,200,0,0,0,True,True,9)@ addbutton(form1,btnDialog1,25,95,120,23,"Dialog 1 btn",212,208,200,0,0,0,True,True,9)@ addlabel(form1,lblAnswer,20,25,185,25,"",220,220,220,0,0,0,True,True,9)@ End Sub @EndOfDesignText@Sub Globals Dim BtnId ' indication of the button pressed such as "btn1" Dim BtnNo End Sub Sub App_Start Form1.Show lblAnswer.Text="PressedButton = "&DialogFormNew("Do either THIS (press Yes) or THAT (press No)","Yes","No","") '-- Current user interaction with MsgBox: requires stylus and has few options ' BtnPressed = Msgbox("Do either THIS (press Yes) or THAT (press No)","", cMsgBoxYesNo) '-- Desired user interaction with separate form which has large buttons and better information ' with a separate Sub called e.g. DialogForm which should be called just as the MsgBox function ' and returns a number for the button pressed ' BtnPressed= DialogForm("Text for 1. button","Text for 2. button") '******* ' If BtnPressed=6 Then ' ' This should apply in case button 1 was pressed ' Msgbox("1. alternative") ' Else If BtnPressed = 7 Then ' ' This should apply in case button 2 was pressed ' Msgbox("2. alternative") ' End If End Sub Sub btnDialog1_Click lblAnswer.Text="PressedButton = "&DialogFormNew("Do THIS (press Yes) ","Yes","","") End Sub Sub btnDialog2_Click lblAnswer.Text="PressedButton = "&DialogFormNew("Do either THIS (press Yes) or THAT (press No) or Cancel ","Yes","No","Cancel") End Sub Sub btnDialog3_Click lblAnswer.Text="PressedButton = "&DialogFormNew("Do either THIS (press Yes) or THAT (press No) or Cancel ","Yes","No","Cancel") End Sub Sub btnDialogUser_Click lblAnswer.Text="PressedButton = "&DialogFormNew("Do either THIS (press Yes) or THAT (press No) or Cancel ","User","No","Cancel") End Sub #Region DialogFormNew routines Sub DialogFormNew(Txt,TxtBtn1,TxtBtn2,TxtBtn3) frmDialog.Show lblText.Text=Txt BtnId=0 btn1.Text=TxtBtn1 If TxtBtn1<>"" Then btn1.Visible=true Else btn1.Visible=false End If btn2.Text=TxtBtn2 If TxtBtn2<>"" Then btn2.Visible=true Else btn2.Visible=false End If btn3.Text=TxtBtn3 If TxtBtn3<>"" Then btn3.Visible=true Else btn3.Visible=false End If Do ' waiting loop DoEvents Loop Until BtnId>0 frmDialog.Close Return BtnId End Sub Sub btn1_Click ' BtnId=1 ' this works with any button name, but you know what each button doas meen If Btn1.Text="Yes" Then BtnId=cYes ' returns the yes number Else BtnId=11 ' returns user defined number End If End Sub Sub btn2_Click BtnId=2 BtnId=cNo ' this works only if you use allwas the same buttons on the same place End Sub Sub btn3_Click BtnId=3 BtnId=cCancel ' this works only if you use allwas the same buttons on the same place End Sub Sub frmDialog_Close If BtnId=0 Then DialogFormNew(lblText.Text,btn1.Text,btn2.Text,btn3.Text) ' to avoid that the user closes the the form with exit button End If End Sub #End Region