From 7905d3af4d32405ef041de897bf2d23ee7d6d08e Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 14 Jun 2023 15:23:33 +0300 Subject: Add custom panel and tools --- Tools/Button3Tool.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Tools/Button3Tool.cs (limited to 'Tools/Button3Tool.cs') diff --git a/Tools/Button3Tool.cs b/Tools/Button3Tool.cs new file mode 100644 index 0000000..853ed95 --- /dev/null +++ b/Tools/Button3Tool.cs @@ -0,0 +1,24 @@ +using Application = Microsoft.Office.Interop.Excel.Application; + +namespace ExcelAddIn.Tools; + +public class Button3Tool : Tool +{ + private readonly Application app; + public Button3Tool() + { + app = (Application)ExcelDnaUtil.Application; + } + public override void Execute() + { + for (int i = 0; i < 10;) + { + Thread.Sleep(400); + app.StatusBar = $"Выполнено {++i * 10}%..."; + } + } + protected override void Dispose(bool disposing) + { + app.StatusBar = false; + } +} \ No newline at end of file -- cgit v1.2.3