Help required creating a dialog box
Help required creating a dialog box
(OP)
I have some code that builds a dialog box with two options the user can choose. I donot know in advance how many options the user will require and so I am going to cater for up to 20 options.
I want to modify this code that creates a predefined number of options the user can choose.
I want to create the options depending if variables get populated.
begin dialog userdialog1 183, 75, “choose”
groupbox 5, 4, 97, 47 “”
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, “findt”
optionbutton 16, 30, 67, 8, “delete”
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
dim mydialog as userdialog1
on error resumenext
dialog mydialog1
if err=102 then
msbox “ marco has hit a problem and has exited”
end if
bla
bla
bla
end sub
I was thinking of something like this below. The first option will always be created, the second would only be created if the variable gets populated. I will have 20 different variables and for each one that gets populated I want to create and option
Dim myvariable as string
begin dialog userdialog1 183, 75, “choose”
groupbox 5, 4, 97, 47 “”
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, “findt”
if myvariable = “found” then
optionbutton 16, 30, 67, 8, “delete”
end if
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
Attachamate does not seem to like the IF/End if
at least not the way I have done it, is there a way to do this?
thank you smiler44
I want to modify this code that creates a predefined number of options the user can choose.
I want to create the options depending if variables get populated.
begin dialog userdialog1 183, 75, “choose”
groupbox 5, 4, 97, 47 “”
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, “findt”
optionbutton 16, 30, 67, 8, “delete”
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
dim mydialog as userdialog1
on error resumenext
dialog mydialog1
if err=102 then
msbox “ marco has hit a problem and has exited”
end if
bla
bla
bla
end sub
I was thinking of something like this below. The first option will always be created, the second would only be created if the variable gets populated. I will have 20 different variables and for each one that gets populated I want to create and option
Dim myvariable as string
begin dialog userdialog1 183, 75, “choose”
groupbox 5, 4, 97, 47 “”
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, “findt”
if myvariable = “found” then
optionbutton 16, 30, 67, 8, “delete”
end if
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog
Attachamate does not seem to like the IF/End if
at least not the way I have done it, is there a way to do this?
thank you smiler44
RE: Help required creating a dialog box
here's one in particular:
http://www.tek-tips.com/viewthread.cfm?qid=1276471
RE: Help required creating a dialog box
Begin Dialog ThatDlg 50, 50, "DlgBox", .ThatFileDlgFunc
DropListBox 5, 5, 40, 42, List1(), .Drop1
For i = 0 to 6
For j = 0 to 9
MsgBox str(j) & "," & str(i) & " = " & AllTheInfo(j,i)
Next
Next
i tried declaring I and J as strings but that did not work. if i dont declare them as strings then the code just fails on
Begin Dialog ThatDlg 50, 50, "DlgBox", .ThatFileDlgFunc
DropListBox 5, 5, 40, 42, List1(), .Drop1
MsgBox str(j) & "," & str(i) & " = " & AllTheInfo(j,i)
would apprecitae further advice. :)
thank you smiler44
RE: Help required creating a dialog box
if whatever then
bla
bla
end if
this does work
if whatever then
bla
bla
Elseif what ever then
bla
bla
end if
thank you remy998 for all your help
smiler44
RE: Help required creating a dialog box
if you want to use an opening dialog box to generate additional dialog boxes based on a variable, then it would make sense to create different subs for each of the dialog boxes that is required.
RE: Help required creating a dialog box
I may be asking the wrong question and using the term dialog box incorrectly. I want to create a "screen/page" that has upto 20 option buttons, in fact I think they are also known as radio buttons that the user can select, one at a time. An option/radio button is only built if variable1, variable2 strings etc are populated.
smiler44