我有一个在单独线程中运行的查询,需要一段时间才能处理,因为用户当前无法知道后台正在执行某些操作,我想创建一个进度条,例如第三个进度条此图片:
我查看了其他问题/答案,看起来选框进度条就是我想要的,我尝试将进度条设置为选框,但它没有执行任何操作。进度条属性如下:
MarqueeInterval = 10
Max = 100
Min = 50
Orientation = pbHorizontal
Position = 50
Smooth = True
State = pbsNormal
Step = 10
Style = pbstMarquee
我做错了什么或者需要改变吗?
我的启动代码如下:
procedure TFormMain.SetupForm;
begin
// Connect to the database
ConnectToDatabase;
// Initially hide combo box
ShowHideComboBox(False);
ListViewDataType.Columns[0].Width := -1;
UsingOwnTemplate := False;
// Initial page is the welcome page
PageControl.ActivePage := TabWelcome;
end;
procedure TFormMain.ConnectToDatabase;
var
FullPath : String;
CompanyName: String;
begin
// Create the database connection
DBConnection := TFDConnection.Create(nil);
// Get the folder path
FullPath := GetCurrentDir;
DatabasePath := FullPath;
// Setup the database connection
with DBConnection do begin
DriverName := 'MSAcc';
Params.Add(Format('Database=%s', [DatabasePath]));
Params.Add('StringFormat=UNICODE');
Connected := True;
end;
end;
最佳答案
放置一个 TProgressBar
并将其 Style
属性设置为 pbstMarquee
。
应该就这样了,如果不起作用,请确保:
关于Delphi跑马灯进度条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57376486/