myradio :array [0..9,0..4] of Tradiobutton;
myradioGroup :array[0..9] of TRadioGroup;
num1:integer = 9;
num2:integer =4; //initalize radiogroup
for i:=0 to num1 do
begin
myradiogroup[i]:=TradioGroup.Create(self);
if(i<=num2) then myradiogroup[i].parent:= TabSheet1 //是选项卡1
else myradiogroup[i].parent:= tabsheet2; //是选项卡2
myradiogroup[i].left:= 32;
myradiogroup[i].width:=350;
myradiogroup[i].top:= 16+(i mod 5)*80;
myradiogroup[i].height:=65;
end; //initalize radiobutton
for i:=0 to num1 do
for j:=0 to num2 do
begin
myradio[i][j]:= TradioButton.create(self);
myradio[i][j].parent:= myradiogroup[i];
myradio[i][j].left:= 32+(j mod 5)*60;
myradio[i][j].top:= 32+(i mod 5)*80;
case j of
0 : myradio[i][j].Caption:='A';
1 : myradio[i][j].Caption:='B';
2 : myradio[i][j].Caption:='C';
3 : myradio[i][j].Caption:='D';
4 : myradio[i][j].Caption:='E';
end;
end;
显示的结果非常奇怪,在两个选项卡上都能各正确显示5个radiogroup,但是只有最顶上面的radiogroup(也就是下标是0和5的那两个)里面有radiobutton,其他的里面都是空的!
为什么会这样呢?
谢谢高手指点
myradioGroup :array[0..9] of TRadioGroup;
num1:integer = 9;
num2:integer =4; //initalize radiogroup
for i:=0 to num1 do
begin
myradiogroup[i]:=TradioGroup.Create(self);
if(i<=num2) then myradiogroup[i].parent:= TabSheet1 //是选项卡1
else myradiogroup[i].parent:= tabsheet2; //是选项卡2
myradiogroup[i].left:= 32;
myradiogroup[i].width:=350;
myradiogroup[i].top:= 16+(i mod 5)*80;
myradiogroup[i].height:=65;
end; //initalize radiobutton
for i:=0 to num1 do
for j:=0 to num2 do
begin
myradio[i][j]:= TradioButton.create(self);
myradio[i][j].parent:= myradiogroup[i];
myradio[i][j].left:= 32+(j mod 5)*60;
myradio[i][j].top:= 32+(i mod 5)*80;
case j of
0 : myradio[i][j].Caption:='A';
1 : myradio[i][j].Caption:='B';
2 : myradio[i][j].Caption:='C';
3 : myradio[i][j].Caption:='D';
4 : myradio[i][j].Caption:='E';
end;
end;
显示的结果非常奇怪,在两个选项卡上都能各正确显示5个radiogroup,但是只有最顶上面的radiogroup(也就是下标是0和5的那两个)里面有radiobutton,其他的里面都是空的!
为什么会这样呢?
谢谢高手指点
解决方案 »
- 如何将图片的边缘位置加上一个撕边效果?
- 数据库连接问题
- 向web server发送GET 后无相应的问题,高手请进!
- 散分+咨询想找人开发一个网络休闲游戏,大概需要多少钱?
- dbgrideh 怎样设置才使其实现某列的自动统计功能
- 在DELPHI中如何把String转换到一个字符数组中!救命的啊!
- 请问如何使自己的程序永远在桌面上最前面
- NMSMTP控件发邮件的问题,苦恼!
- 长问题高分求教(成功立即送分):数据库开发中ADO与BDE的可移植性孰好孰差?如果在代码中直接配置,如何去做?
- 何何识别一个数据的类型(数字?日期?文本?)
- 这个是怎么回事,照大家说的改过了,代码还是有错,大家帮一下我呀
- Delphi7读取DBF数据,无法找到字段内容
不想看了估计问题是,子、父窗体没设好
个你个我写的代码吧
是动态创建label
======
var
NewLabel:TLabel;==
NewLabel := TLabel.Create(NewForm);//注意其中参数
NewLabel.Parent := NewForm;//定义你的主窗体
NewLabel.Left := left;
NewLabel.Top := top;
NewLabel.Height := 13;
NewLabel.Caption := FieldByName('name').AsString;
NewLabel.Font.Color := clRed;
NewLabel.AutoSize := true;
NewLabel.Font.Style := [fsUnderline];
NewLabel.OnClick := NewLabelClick;//绑定事件