fBottom:= Panel3.Top + Panel3.Height; OutPutDebugString(PChar('Panel3.Bottom: '+IntToStr(panel3.Top + Panel3.Height)+#13#10)); Case i of //FloatToStr(FigureValue); 1:begin ValEdit1.Text:= Format(strFormatDecnum[i],[FigureValue]); Label38.Caption:= ValEdit1.Text+'m'; OutputDebugString(Pchar('油高: '+Label38.Caption+#13#10)); nValue:=ABS(FigureValue); if nHeigh > 0.000001 then nInt:=Round(nValue*panel3.Height/nHeigh) else nInt:= 0; { if nInt<=0 then begin OilImage.Visible:=False; Label38.Visible:=False; OilEdit.Visible:=False; end else begin OilImage.Visible:=True; Label38.Visible:=True; OilEdit.Visible:=True; } if nInt = 0 then OilImage.Height:= fBottom else OilImage.Height:=nInt; OilImage.Top:= 0; inta:= (380 - 75); OilImage.Top:= 305; OilEdit.Top:=OilImage.Top; OutPutDebugString(PChar('OilImage.Top: '+IntToStr(OilImage.Top)+#13#10)); Label38.Top:=OilEdit.Top-9; //end; end; 2:begin ValEdit2.Text:=Format(strFormatDecnum[i],[FigureValue]); Label39.Caption:=Format(strFormatDecnum[i],[FigureValue])+'m'; OutputDebugString(Pchar('水高: '+Label39.Caption+#13#10)); nValue:=ABS(FigureValue); if nHeigh > 0.000001 then nInt:=Round(nValue*panel3.Height/nHeigh) else nInt:= 0; { outPutDebugString(PChar('')); if nInt<=0 then begin WaterImage.Visible:=False; Label39.Visible:=False; WaterEdit.Visible:=False; end else begin WaterImage.Visible:=True; Label39.Visible:=True; WaterEdit.Visible:=True; } OutPutDebugString(PChar('nInt: '+IntToStr(nInt)+#13#10)); if nInt = 0 then WaterImage.Height:= fBottom else WaterImage.Height:=nInt; WaterImage.Top:= 0; inta:= 380 - 1; WaterImage.Top:= 379; OutPutDebugString(PChar('WaterImage.Top: '+IntToStr(WaterImage.Top)+#13#10)); WaterEdit.Top:=WaterImage.Top; Label39.Top:=WaterEdit.Top + 9; // end; end;
thank u all the same 我先回去了 明天再说了 谢谢了 ;{}
我觉得你这段代码有点问题: if nInt<=0 then begin OilImage.Visible:=False; Label38.Visible:=False; OilEdit.Visible:=False; end else begin OilImage.Visible:=True; Label38.Visible:=True; OilEdit.Visible:=True; if nInt = 0 then OilImage.Height:= fBottom else OilImage.Height:=nInt; OilImage.Top:= 0; inta:= (380 - 75); OilImage.Top:= 305; 如果是你说的复制没起作用的话,好像就这段的问题。
但赋给OilImage.Top的操作好像没用吗
OutPutDebugString(PChar('Panel3.Bottom: '+IntToStr(panel3.Top + Panel3.Height)+#13#10));
Case i of //FloatToStr(FigureValue);
1:begin
ValEdit1.Text:= Format(strFormatDecnum[i],[FigureValue]);
Label38.Caption:= ValEdit1.Text+'m';
OutputDebugString(Pchar('油高: '+Label38.Caption+#13#10));
nValue:=ABS(FigureValue);
if nHeigh > 0.000001 then
nInt:=Round(nValue*panel3.Height/nHeigh)
else
nInt:= 0; { if nInt<=0 then
begin
OilImage.Visible:=False;
Label38.Visible:=False;
OilEdit.Visible:=False;
end
else begin
OilImage.Visible:=True;
Label38.Visible:=True;
OilEdit.Visible:=True; }
if nInt = 0 then
OilImage.Height:= fBottom
else
OilImage.Height:=nInt; OilImage.Top:= 0;
inta:= (380 - 75);
OilImage.Top:= 305;
OilEdit.Top:=OilImage.Top;
OutPutDebugString(PChar('OilImage.Top: '+IntToStr(OilImage.Top)+#13#10));
Label38.Top:=OilEdit.Top-9;
//end;
end;
2:begin
ValEdit2.Text:=Format(strFormatDecnum[i],[FigureValue]);
Label39.Caption:=Format(strFormatDecnum[i],[FigureValue])+'m';
OutputDebugString(Pchar('水高: '+Label39.Caption+#13#10));
nValue:=ABS(FigureValue);
if nHeigh > 0.000001 then
nInt:=Round(nValue*panel3.Height/nHeigh)
else
nInt:= 0; { outPutDebugString(PChar('')); if nInt<=0 then
begin
WaterImage.Visible:=False;
Label39.Visible:=False;
WaterEdit.Visible:=False;
end
else begin
WaterImage.Visible:=True;
Label39.Visible:=True;
WaterEdit.Visible:=True; }
OutPutDebugString(PChar('nInt: '+IntToStr(nInt)+#13#10));
if nInt = 0 then
WaterImage.Height:= fBottom
else
WaterImage.Height:=nInt; WaterImage.Top:= 0;
inta:= 380 - 1;
WaterImage.Top:= 379;
OutPutDebugString(PChar('WaterImage.Top: '+IntToStr(WaterImage.Top)+#13#10));
WaterEdit.Top:=WaterImage.Top;
Label39.Top:=WaterEdit.Top + 9;
// end;
end;
我先回去了
明天再说了
谢谢了
;{}
if nInt<=0 then
begin
OilImage.Visible:=False;
Label38.Visible:=False;
OilEdit.Visible:=False;
end
else
begin
OilImage.Visible:=True;
Label38.Visible:=True;
OilEdit.Visible:=True;
if nInt = 0 then
OilImage.Height:= fBottom
else
OilImage.Height:=nInt; OilImage.Top:= 0;
inta:= (380 - 75);
OilImage.Top:= 305;
如果是你说的复制没起作用的话,好像就这段的问题。