简单程序,但是出现错误!
希望大家帮帮忙/谢谢了!代码:unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls;type
TForm1 = class(TForm)
ScrollBox1: TScrollBox;
Image1: TImage;
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
xx , yy : integer ;
st : bool ;implementation{$R *.dfm}procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
xx := x ;
yy := y ;
st := true ;
end;procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if st then
begin
scrollbox1.HorzScrollBar.Position:=scrollbox1.HorzScrollBar.Position(X -xx);
scrollbox1.VertScrollBar.Position:=scrollbox1.VertScrollBar.Position(Y -yy);
xx := x ;
yy := y ;
end ;
end;procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
st := false ;
end;end.
希望大家帮帮忙/谢谢了!代码:unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls;type
TForm1 = class(TForm)
ScrollBox1: TScrollBox;
Image1: TImage;
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
xx , yy : integer ;
st : bool ;implementation{$R *.dfm}procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
xx := x ;
yy := y ;
st := true ;
end;procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if st then
begin
scrollbox1.HorzScrollBar.Position:=scrollbox1.HorzScrollBar.Position(X -xx);
scrollbox1.VertScrollBar.Position:=scrollbox1.VertScrollBar.Position(Y -yy);
xx := x ;
yy := y ;
end ;
end;procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
st := false ;
end;end.
scrollbox1.VertScrollBar.Position:=scrollbox1.VertScrollBar.Position(Y -yy);
就是这两行出现错误[47]Missing operator or semicolon
[47]Missing operator or semicolon
这个调用有反回值吗?如果有返回值,那么类型匹配吗?抱歉,我只是看着代码回复的,目前机器上没有相应的条件帮你查阅.