办我看下delphi的代码为什么是错误的
unitUnit2;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,F...
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, jpeg;
type
TForm2 = class(TForm)
Image1: TImage;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure Label1Click(Sender: TObject);
procedure Label2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.Label1Click(Sender: TObject);
begin
if edit1.text=('669822')then
WinExec('g:\yy\1.exe',sw_normal)
Form2.hide
else
showmessage('密码输入错误请重新输入')
end;
procedure TForm2.Label2Click(Sender: TObject);
begin
close
end;
end.
我想调用exe程序后,隐藏或关闭这个登陆对话框。
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, jpeg;
type
TForm2 = class(TForm)
Image1: TImage;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure Label1Click(Sender: TObject);
procedure Label2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1, Unit3;
{$R *.dfm}
procedure TForm2.Label1Click(Sender: TObject);
begin
if edit1.text=('669822')then
Form2.hide
Form1.ShowModal
else
showmessage('密码输入错误请重新输入')
end;
end.
我想用的就是把Form2关了,调用form1窗口,可是Form1.ShowModal这句就错了。 展开
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, jpeg;
type
TForm2 = class(TForm)
Image1: TImage;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure Label1Click(Sender: TObject);
procedure Label2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.Label1Click(Sender: TObject);
begin
if edit1.text=('669822')then
WinExec('g:\yy\1.exe',sw_normal)
Form2.hide
else
showmessage('密码输入错误请重新输入')
end;
procedure TForm2.Label2Click(Sender: TObject);
begin
close
end;
end.
我想调用exe程序后,隐藏或关闭这个登陆对话框。
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, jpeg;
type
TForm2 = class(TForm)
Image1: TImage;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure Label1Click(Sender: TObject);
procedure Label2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1, Unit3;
{$R *.dfm}
procedure TForm2.Label1Click(Sender: TObject);
begin
if edit1.text=('669822')then
Form2.hide
Form1.ShowModal
else
showmessage('密码输入错误请重新输入')
end;
end.
我想用的就是把Form2关了,调用form1窗口,可是Form1.ShowModal这句就错了。 展开
3个回答
展开全部
procedure TForm2.Label1Click(Sender: TObject);
begin
if edit1.text=('669822')then
WinExec('g:\yy\1.exe',sw_hide);
//少了分号,调用API,你要隐藏运行调用,就用SW_HIDE 具体你查一下那个API的使用参数
end
else
showmessage('密码输入错误请重新输入');
又少分号。
end;
procedure TForm2.Label2Click(Sender: TObject);
begin
close
//少了一个分号,应该是close;
end;
end.
begin
if edit1.text=('669822')then
WinExec('g:\yy\1.exe',sw_hide);
//少了分号,调用API,你要隐藏运行调用,就用SW_HIDE 具体你查一下那个API的使用参数
end
else
showmessage('密码输入错误请重新输入');
又少分号。
end;
procedure TForm2.Label2Click(Sender: TObject);
begin
close
//少了一个分号,应该是close;
end;
end.
展开全部
...
if edit1.text=('669822')then
begin
WinExec('g:\yy\1.exe',sw_normal);
Form2.hide;
多于1句的语句用bein..end包起来,还有就是句末的";"
end
else
showmessage('密码输入错误请重新输入');
if edit1.text=('669822')then
begin
WinExec('g:\yy\1.exe',sw_normal);
Form2.hide;
多于1句的语句用bein..end包起来,还有就是句末的";"
end
else
showmessage('密码输入错误请重新输入');
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2010-04-29
展开全部
procedure tform2.label1.click(sender:tobject);
if edit1.text=('669822')then
begin
WinExec('g:\yy\1.exe',sw_normal)
form2.hide
else
showmessage('密码输入错误请重新输入')
end;
proceudre tform2.label2click(sender:tobejct);
begin
close;
end;
if edit1.text=('669822')then
begin
WinExec('g:\yy\1.exe',sw_normal)
form2.hide
else
showmessage('密码输入错误请重新输入')
end;
proceudre tform2.label2click(sender:tobejct);
begin
close;
end;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询