Jump to content

UnimRadio:Dynamic created,but can not set checked,why?


55143681

Recommended Posts

cb10.3.3+unigui1546.

Dear:

I use the follow code to create some UnimRadios and UnimCheckBoxs,

UnimCheckBox can be set checked,but UnimRadio can not be set checked,why?

TUnimRadio *newRadio=new TUnimRadio(this);

newRadio->Checked=true;//No effect

TUnimCheckBox *newCheck=new TUnimCheckBox(this);

newCheck->Checked=true;//Works well

Link to comment
Share on other sites

25 minutes ago, Sherzod said:

Hello,

 

Thanks alot.sherzod       

TUnimRadio *newRadio=new TUnimRadio(this);
        newRadio->Name="newRadio"+String(choId);
        newRadio->Parent=UnimPanel2;
        newRadio->Top=10+50*(choNo-1);
        newRadio->Left=10;
        newRadio->FieldLabelFont->Size=15;
        newRadio->FieldLabelFont->Color=clBlack;
        newRadio->FieldLabelAlign=laRight;
        newRadio->FieldLabel="["+choId+"]"+choText;
        //如果是重返题目则根据原始答案进行勾选
        if(tmpText[subNo].Pos(choId)>0)
            {
            myRadio->Checked=true;
            newRadio->JSInterface->JSAddListener("painted", "function(){this.setChecked(true)}");//解决选中不显示的BUG
            }

Link to comment
Share on other sites

×
×
  • Create New...