为什么我的程序,要到数据映射提示框出现后ProgressBar才开始有变化?
加上Timer1.Enabled := False;这句直接就没有反应,谁能给我讲解一下到底怎么回事吗?
procedure TForm1.Button1Click(Sender: TObject);
var
I : Integer;
begin
if edit1.Text <> '' then
begin
if Application.MessageBox('确认要将此数据库对应?','提示',MB_IConInformation + MB_OKCancel) = IdOk then
begin
Timer1.Enabled := True;
//GetTime := GetTickCount; //DataModule1.ADoConnection1.Connected := False;
//DataModule1.ADOConnection1.ConnectionString := ConnStr;
//DataModule1.ADOConnection1.Connected := True; //SelectData; //DataModule1.AdoDataSet1.Close; //ExecuteTime := GetTickCount - GetTime; //Timer1.Enabled := False;
Application.MessageBox('数据映射完毕!','提示',MB_IConInformation + MB_OK);
//edtText.SetFocus;
end
else
Exit;
end
else
begin
Application.MessageBox('请选择文件!','提示',MB_IConInformation + MB_OK);
//edtData.SetFocus;
end;
end;procedure TForm1.Timer1Timer(Sender: TObject);
var
I : Integer;
begin
for I := 0 to 100 do
begin
ProgressBar1.StepIt;
ProgressBar1.Position := ProgressBar1.Position + 1;
ProgressBar1.Update;
end;
end;
加上Timer1.Enabled := False;这句直接就没有反应,谁能给我讲解一下到底怎么回事吗?
procedure TForm1.Button1Click(Sender: TObject);
var
I : Integer;
begin
if edit1.Text <> '' then
begin
if Application.MessageBox('确认要将此数据库对应?','提示',MB_IConInformation + MB_OKCancel) = IdOk then
begin
Timer1.Enabled := True;
//GetTime := GetTickCount; //DataModule1.ADoConnection1.Connected := False;
//DataModule1.ADOConnection1.ConnectionString := ConnStr;
//DataModule1.ADOConnection1.Connected := True; //SelectData; //DataModule1.AdoDataSet1.Close; //ExecuteTime := GetTickCount - GetTime; //Timer1.Enabled := False;
Application.MessageBox('数据映射完毕!','提示',MB_IConInformation + MB_OK);
//edtText.SetFocus;
end
else
Exit;
end
else
begin
Application.MessageBox('请选择文件!','提示',MB_IConInformation + MB_OK);
//edtData.SetFocus;
end;
end;procedure TForm1.Timer1Timer(Sender: TObject);
var
I : Integer;
begin
for I := 0 to 100 do
begin
ProgressBar1.StepIt;
ProgressBar1.Position := ProgressBar1.Position + 1;
ProgressBar1.Update;
end;
end;
解决方案 »
- 带var参数的函数,在两个文件间的问题,急。。。
- 囧 ◆◆一个关于用Delphi做双机热备份的方案,紧急征求意见和改进措施◆◆◆◆
- 寻找一个控件 100分求
- DbLookupComboBox控件怎样显示全部内容
- 字段的OnGetText事件中可以只改变其中你选的DBGRID的列的中的1个单元格的内容么
- 谁有可用分啊?给点 555555555555
- 怎样控制键盘对dbgrid的控制?我在插入记录时,只能让它在这一行移动,该怎么做?
- TabControl 控件的使用————在线等待!!!!急呀!!
- 请解我忧,网络数据库的问题
- delphi作的Web Service,可调用时出现这种错误,请进
- [讨论]邪门的问题,为什么会这样啊??!!cbc & delphi....
- 疑惑:怎么在OCX中取得自己的所在文件夹路径
procedure TForm1.Timer1Timer(Sender: TObject);
var
I : Integer;
begin
for I := 0 to 100 do
begin
ProgressBar1.StepIt;
Application.ProcessMessages;
end;
end;