PDA

View Full Version : Problem with Listbox Visibility



Blypht
07-17-2004, 01:35 AM
I'm having a problem controlling the visibility of Listbox controls. If you run the example below, you'll see that the scroll bars appear and disappear, but the boxes themselves are always visible.

Anybody have a workaround?

Or am I simply missing something?

Thanks in advance!

@version 2.3
@warnings
@script generic
@name "Listbox Visibility"

// Global controls
c2;
c3;

// Global variables
arrC2 = @ "A1","A2","A3","A4","A5" @;
arrC3 = @ "B1","B2","B3","B4","B5" @;

generic
{
ordVisible = 1;

reqbegin("Listbox Visibility");
reqsize(188,118);

c1 = ctlchoice("Visible",ordVisible,@"Listbox A","Listbox B"@);
ctlposition(c1,0,0);
ctlrefresh(c1,"c1_refresh");

c2 = ctllistbox("A",50,50,"c2_count","c2_name");
ctlposition(c2,25,30,50,50);

c3 = ctllistbox("B",50,50,"c3_count","c3_name");
ctlposition(c3,110,30,50,50);
c3.visible(false);

return if !reqpost();

reqend();
}

c1_refresh: value
{
switch (value)
{
case 1:
c2.visible(true);
c3.visible(false);
break;
case 2:
c2.visible(false);
c3.visible(true);
break;
}

}

c2_count
{
return(arrC2.count());
}

c2_name: Index
{
return(arrC2[Index]);
}

c3_count
{
return(arrC3.count());
}

c3_name: Index
{
return(arrC3[Index]);
}

Blypht
07-21-2004, 03:41 PM
Okay, okay. I figured it out.

.visible doesn't seem to work on ctllistbox controls. And I have my doubts about .active, too.

However, ctlvisible(...) and ctlactive(...) work very nicely.

Thanks to the 13 of you who at least looked at my problem, even if you didn't reply. :D

faulknermano
07-22-2004, 02:59 AM
Originally posted by Blypht
Okay, okay. I figured it out.

.visible doesn't seem to work on ctllistbox controls. And I have my doubts about .active, too.

However, ctlvisible(...) and ctlactive(...) work very nicely.

Thanks to the 13 of you who at least looked at my problem, even if you didn't reply. :D

i think the .visible() messages are better for non-modal panels.