First of all, since only one of the arrays is active at a time, it sounds like you
want to use a
radio group, rather than a checkbox.
IF you have a type such as
type lbls
ttl as string
lbl (0) as string
end type
and global variables
dim dlg_lbl as lbls
dim dlg_one as logical
dim dlg_cat as smallint
dim dlg_sel as smallint
and you've filled in dlg_lbl,
then down in your dialog box code, you can do soemthing like
this:
function MyDialog (cat as smallint, sel as smallint) as logical
dim rgttl as string
dim u as smallint
dim i as smallint
dim l as smallint
dim m as smallint
dim c as smallint
dim s as smallint
u = ubound (dlg_lbl)
if u = 0
then MyDialog = FALSE
exit function
end if
rgttl = dlg_lbl.ttl (1)
m = len (rgttl)
if u = 1
then dlg_one = TRUE
else dlg_one = FALSE
for i = 2 to u
rgttl = rgttl + ";"+dlg_lbl (i).ttl
l = len (dlg_lbl (i).ttl)
if l > m
then m = l
end if
next
end if
if (cat <= 0) or (cat > m)
then c = 1
s = 1
else c = cat
if (sel <= 0) or (sel > ubound (dlg_lbl (c).lbl))
then s = 1
else s = sel
end if
end if
dialog title "mydialog"
calling mydialogenabler
control statictext title rgttl
ID 1
width m*6 position 4, 4 hide
control radiogroup title rgttl
ID 2
position 4, 4
disable hide
calling chose_cat
value dlg_cat
into cat
control PopupMenu width 150
title from variable dlg_lbl (dlg_cat)
value i
ID 3
into sel
control OKButton
control CancelButton
MyDialog = CommandInfo (CMD_INFO_DLG_OK)
end function
sub MyDialogEnabler
if dlg_one
then alter control 1 show
else alter control 2 enable show
end if
end sub
sub chose_cat
alter control 3 title from variable dlg_lbl (ReadControlValue(2)).lbl value 1
end sub
Ben Crane <[EMAIL PROTECTED]> wrote:
Hi List,
A quick question: I have a dialog box with 6
checkbox's, every time a checkbox is clicked on I want
a specific array (I have 6 different arrays) to appear
depending on what checkbox was clicked (I used
triggercontrol for this). BUT, Everything in the alter
control code below works so that there is only 1 set
of code to control ALL six checkboxes. But depending
on which checkbox is activated, I want a different
array to be loaded into a popupmenu. How do I do this
without creating reams of code...I thought I could
use
Alter Control XXX Title From Variable Test(X) where
test contains the array names and X the stripped down
ID number of the checkbox, hence replacing Test(X)
with the correct array...it doesn't work..
Any ideas please? I don't want duplicate code and I
believe this method can work...it's all about
efficiency!
Sub CheckBoxHandler
Dim x as integer
X = TriggerControl()
Do Case X
Case X
If (ReadControlValue(X)) = 1 Then
Alter Control left$(str$(X), 1) Title From Variable
**Variable**
Alter Control left$(str$(X), 1) Show
StreetControl = TRUE
Else Alter Control left$(str$(X), 1) Hide
StreetControl = FALSE
End If
End Case
End Sub
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]