﻿version
5.80
0
Form1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
238
268

0
0
0
Sub designer



addform(Form1,"Form1","",220,220,220)@
End Sub
@EndOfDesignText@Sub Globals
	Dim BtnId	' indication of the button pressed such as "btn1"
End Sub
 

Sub App_Start
 	Form1.Show

'-- 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 DialogForm(Button1Text, Button2Text)
	Form1.Show

 	AddButton("Form1","Btn1",10,10,220,80)
	Btn1.Text = Button1Text
	AddEvent("Btn1",Click, "Btn_Click")
	
  	AddButton("Form1","Btn2",10,100,220,80)
	Btn2.Text = Button2Text
	AddEvent("Btn2",Click, "Btn_Click")
	DoEvents
	'--- Here I would want to interrupt/halt the program until a button is pressed (Btn_Click event) but then I would want to return
	'    the number of the button to the previous Sub which called DialogForm

	BtnNo=0
	If BtnId = "btn1" Then BtnNo = 6	'-- "6" chosen as it corresponds to first button of MsgBox
	If BtnId = "btn2" Then BtnNo = 7	'-- "7" chosen as it corresponds to second button of MsgBox
'	Form1.Close
	Return BtnNo
End Sub
 
Sub Btn_Click
	BtnId = Sender
	Return
'  how can I return BtnId to the the calling sub (DialogForm) which then evaluates the information and returns the Button number to the main program
End Sub
