From b6a509928253ca349a6e39d36a6ee84c8a3e1751 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 12 Jan 2015 12:50:31 +0000 Subject: [PATCH] added load event handler to page, and change button text whilst refreshing. --- Saviour Backup System/backupViewer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Saviour Backup System/backupViewer.cs b/Saviour Backup System/backupViewer.cs index eb61548..6fe3acc 100644 --- a/Saviour Backup System/backupViewer.cs +++ b/Saviour Backup System/backupViewer.cs @@ -31,6 +31,7 @@ namespace Saviour_Backup_System tempTip.SetToolTip(this.refreshButton, "Refresh List\nRefresh the list of backups."); } private void button1_Click(object sender, EventArgs e) { //refresh button + refreshButton.Text = "Refreshing..." DataTable table = databaseTools.getAllDriveBackups(); for (int i = 0; i > table.Rows.Count; i++) { table.Rows[i].SetField(1, tools.unixDateTime( (long)table.Rows[i][1] ).ToString()); //convert time to better format @@ -44,6 +45,7 @@ namespace Saviour_Backup_System table.Columns[4].ColumnName = "Drive Capacity"; dataGridView.DataSource = table; // add table to display + refreshButton.Text = "Refresh"; } @@ -62,5 +64,7 @@ namespace Saviour_Backup_System setup.ABW.drivesDropdown.Enabled = false; setup.ABW.ShowDialog(); } + + private void backupViewer_Load(object sender, EventArgs e) { refreshButton.PerformClick(); } //refresh the database view when form loaded } -} +} \ No newline at end of file