掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
アニメーションについて (ID:150619)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
おはようございます。 アニメーションについて教えてください。 以下のコードで実行したのですが アニメーションが動いてくれません。 [処理内容] ①Excelファイルを選択 ②アニメーション開始 ③選択したExcelファイルのシート名をListViewにリストアップ ④アニメーション終了 何処がおかしいのでしょうか。 *********************************************** if OpenDialog1.Execute then convF.Text := OpenDialog1.FileName; LMaxTime := 10000; LStartTime := TimeGetTime; //アニメーション開始 ActivityIndicator1.Animate := True; LTime := timeGetTime - LStartTime; if LTime > LMaxTime then begin //アニメーション終了 ActivityIndicator1.Animate := False; end; Application.ProcessMessages; Sleep(1); //ListView1にExcelファイルのシート名をリストアップ(Start) System.Variants.DispatchUnsignedAsSigned := True; excelFile := convF.Text; try excel := CreateOleObject( 'Excel.Application' ); excel.Application.WindowState := xlMinimized; excel.Application.Visible := True; book := Excel.WorkBooks.Open(FileName:=excelFile, ReadOnly:=True); try ListView1.Clear; for i := 1 to book.Worksheets.Count do begin ws := book.Worksheets[i]; item1 := ListView1.Items.Add; item1.Caption := ws.Name; end; book.Close(SaveChanges:=False); finally excel.Quit; end; except on E: Exception do MessageDlg(E.Message, mtError, [mbOk], E.HelpContext); end; //ListView1にExcelファイルのシート名をリストアップ(End) ShowMessage('シート名のリストアップが完了しました。'); ActivityIndicator1.Animate := False; //アニメーション終了 *********************************************** 環境:Windows10 Pro Dephi 10.1 Berlin update 2 Enterprise
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.