I came across this code that creates a box with 2 radio buttons on it. The user can choose which button and then pushes
an ok or cancel button. I cannot work out how to adapt it so a textbox/input box is presented so the user can type into the text box and push ok or cancel.
Is it a simple adaptaion or is it more complicated? How do I create an inputbox/textbox for the user to type in to?
thankyou
smiler 44
begin dialog userdialog1 183, 75, "choose" ' 183 = width of dialog box, 75 = height of dialog box
groupbox 5, 4, 97, 47, ""
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, "1st", .optionbutton1 '116 position from left,16 position from top, 46 width of label, 12 not sure height of label perhaps
optionbutton 16, 30, 67, 8, "2nd", .optionbbutton2
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
dim mydialog1 as userdialog1
on error resume next
dialog mydialog1
if err=102 then
msgbox"macro ended"
end if
sasopt = mydialog1.optiongroup1
if sasopt = 0 then
msgbox "zero"
else
if sasopt = 1 then
msgbox "1"
end if
end if
an ok or cancel button. I cannot work out how to adapt it so a textbox/input box is presented so the user can type into the text box and push ok or cancel.
Is it a simple adaptaion or is it more complicated? How do I create an inputbox/textbox for the user to type in to?
thankyou
smiler 44
begin dialog userdialog1 183, 75, "choose" ' 183 = width of dialog box, 75 = height of dialog box
groupbox 5, 4, 97, 47, ""
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, "1st", .optionbutton1 '116 position from left,16 position from top, 46 width of label, 12 not sure height of label perhaps
optionbutton 16, 30, 67, 8, "2nd", .optionbbutton2
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
dim mydialog1 as userdialog1
on error resume next
dialog mydialog1
if err=102 then
msgbox"macro ended"
end if
sasopt = mydialog1.optiongroup1
if sasopt = 0 then
msgbox "zero"
else
if sasopt = 1 then
msgbox "1"
end if
end if