这是一个基于IntraWeb的程序。
这个类本来是为了写一个选项的摸板,其中包括了Label,和几个BUtton。
但是按照如下的程序执行后,却在UR2的位置显示了UR1应该显示的内容,而UR1
的位置却什么都没显示,请问这是为什么??????
////////////////////////////类的实例化///////////////////////////
UR1,UR2:TUserRegion;
UR1:=TUserRegion.Create(50,50,@self,0);
UR2:=TUserRegion.Create(50,200,@self,1);
////////////////////////////类的主体////////////////////////////
type
MyPointer=^TMainForm;
TUserRegion=class(TObject)
   public
   Button1,Button2,Button3,Button4:TIWRadioButton;
   Label1:TIWLabel;
   ThisRegion:TIWRegion;
   constructor Create(x:integer;y:integer;p:MyPointer;n:integer);
end;constructor TUserRegion.Create(x:integer;y:integer;p:MyPointer;n:integer);
begin
UserSession.ADOTable1.First;
UserSession.ADOTable1.MoveBy(n);
////////////////////////////////////////////////////
ThisRegion:=TIWRegion.Create(p^.WebApplication);
ThisRegion.Parent:=p^.IWRegion1;
ThisRegion.Top:=y;
ThisRegion.Left:=x;
ThisRegion.Width:=150;
//ThisRegion.Align:=alTop;
ThisRegion.Height:=100;
ThisRegion.BorderOptions.NumericWidth:=1;
///////////////////////////////////////////////////////
Button1:=TIWRadioButton.Create(p^.webapplication);
Button1.Parent:=ThisRegion;
Button1.Top:=20;
Button1.Left:=0;
Button1.Caption:=UserSession.ADOTable1.Fields[2].Value;
///////////////////////////////////////////////////////
Button2:=TIWRadioButton.Create(p^.webapplication);
Button2.Parent:=ThisRegion;
Button2.Top:=40;
Button2.Left:=0;
Button2.Caption:=UserSession.ADOTable1.Fields[3].Value;
///////////////////////////////////////////////////////
Button3:=TIWRadioButton.Create(p^.webapplication);
Button3.Parent:=ThisRegion;
Button3.Top:=60;
Button3.Left:=0;
Button3.Caption:=UserSession.ADOTable1.Fields[4].Value;
///////////////////////////////////////////////////////
Button4:=TIWRadioButton.Create(p^.webapplication);
Button4.Parent:=ThisRegion;
Button4.Top:=80;
Button4.Left:=0;
Button4.Caption:=UserSession.ADOTable1.Fields[5].Value;
////////////////////////////////////////////////////////
Label1:=TIWLabel.Create(p^.webapplication);
Label1.Parent:=ThisRegion;
Label1.Top:=0;
Label1.Left:=3;
Label1.Caption:=UserSession.ADOTable1.Fields[0].Value+'.'+UserSession.ADOTable1.Fields[1].Value;
////////////////////////////////////////////////////////end;