2

HI,

I created 4 radiobuttons in a intraweb application. One is checked by default, the rest is not. The belong to the same group called group. (I set the group properly of each TIWradiobutton)

There is twiimage image which has click event. In that click event, I tried to set the radiobuttons. E.g. radiobutton1.checked:=true;

The problem is that this sometimes set the radiobutton and sometimes it does not.

I found a fix by setting the rest of radiobuttons.checked to false. That fixed the problem.

I wonder what I did wrong in the first place when I just used one assignment.

Can you tell me if it is a bug in intraweb or I used radiobutton improperly?

Thanks.

4

2 回答 2

2

只需在您的表单中创建一个 IWRadioGroup1(在 iwstanderd 托盘中)

选择 IWRadioGroup1 ,在属性面板 dblclick 上的项目

您将获得一个字符串列表编辑器,逐行键入四个单选按钮的标题,然后单击确定

现在选择你的 IWImage1 ,点击事件只需输入上面的代码

procedure TformMain.IWImage1Click(Sender: TObject);
begin
IWRadioGroup1.ItemIndex := 2 // 2 is the radiobutton number as you typed in stringlist editor
end;
于 2010-10-25T07:06:51.413 回答
1

有时 IW 或基于 IW 构建的组件(例如 IW 的 TMS 套件)会出现奇怪的行为。您可以通过查看代码来了解它是如何工作的,它们是如何管理无线电组后面的 java 脚本的。

此外,有时您必须完全按照 Atozed 在其文档中所说的方式管理组件。

可能不是最好的答案,但如果你经常使用 IW,你会发现它有很多限制和奇怪的行为(只有当你不按照他们的风格工作时,这有时与win32 风格)。

此致,

于 2010-10-25T06:44:39.977 回答