-
Notifications
You must be signed in to change notification settings - Fork 0
/
Important_View.vb
497 lines (412 loc) · 22.6 KB
/
Important_View.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
Public Class Important_View
Private ImportantDT As New DataTable()
Private ImportantDT_TaskTitleOnly As New DataTable()
Private SelectedTask_Item As TaskItem
Private SelectedTask_Properties As TaskProperties
Private SelectedTask_Index As Integer
Private SelectedTask_ID As Integer
Private IsTaskPropertiesVisible As Boolean
#Region "On Load"
' Initializes the form components and enables key preview for handling keyboard events at the form level. '
Sub New()
InitializeComponent()
Me.KeyPreview = True
End Sub
' Form on load : Initializes the Repeated tasks view. '
Private Sub Important_View_Load(sender As Object, e As EventArgs) Handles MyBase.Load
InitializeImportant()
End Sub
' Initializes the Repeated tasks view. '
Private Sub InitializeImportant()
Select Case SettingsCache.TaskPropertiesSidebarStateOnStart ' Sets the Task Properties initial sidebar state based on user setting
Case "Expanded"
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Show)
Case "Collapsed"
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Hide)
End Select
EnableOrDisable_TaskPropertiesSidebar(TaskPropertiesState.Disable)
End Sub
#End Region
#Region "Data Loading Actions"
' Load tasks onto the DataTables
Private Sub LoadTasksToDataTables_Important()
ImportantDT.Clear()
ImportantDT_TaskTitleOnly.Clear()
Dim query As String
Dim queryTitleOnly As String = "SELECT TaskID, Task FROM Tasks " &
"WHERE IsImportant = 1;"
If SettingsCache.HideCompletedTasks Then
query = "SELECT * FROM Tasks " &
"WHERE IsImportant = 1 " &
"AND IsDone = 0 " & ' Filter to show only incomplete tasks
"ORDER BY CASE WHEN ReminderDateTime IS NULL THEN 1 ELSE 0 END, " &
"ReminderDateTime, IsImportant DESC;"
Else
If SettingsCache.SortByCompletionStatus Then
query = "SELECT * FROM Tasks " &
"WHERE IsImportant = 1 " &
"ORDER BY IsDone ASC, " &
"CASE WHEN ReminderDateTime IS NULL THEN 1 ELSE 0 END, " &
"ReminderDateTime, IsImportant DESC;"
Else
query = "SELECT * FROM Tasks " &
"WHERE IsImportant = 1 " &
"ORDER BY CASE WHEN ReminderDateTime IS NULL THEN 1 ELSE 0 END, " &
"ReminderDateTime, IsImportant DESC;"
End If
End If
Using connection As New SqlCeConnection(SettingsCache.connectionString)
connection.Open()
Using command As New SqlCeCommand(query, connection)
command.Parameters.AddWithValue("@Today", DateTime.Today)
Using adapter As New SqlCeDataAdapter(command)
adapter.Fill(ImportantDT)
End Using
End Using
Using command As New SqlCeCommand(queryTitleOnly, connection)
command.Parameters.AddWithValue("@Today", DateTime.Today)
Using adapter As New SqlCeDataAdapter(command)
adapter.Fill(ImportantDT_TaskTitleOnly)
End Using
End Using
End Using
ImportantDT.PrimaryKey = New DataColumn() {ImportantDT.Columns("TaskID")}
ImportantDT_TaskTitleOnly.PrimaryKey = New DataColumn() {ImportantDT_TaskTitleOnly.Columns("TaskID")}
End Sub
' Load important tasks onto the CheckedListBox.
Public Sub LoadTasksToImportantView()
LoadTasksToDataTables_Important()
Important_CheckedListBox.BeginUpdate() ' Prevent UI from redrawing until complete
Important_CheckedListBox.Items.Clear()
For Each row As DataRow In ImportantDT.Rows
Dim taskDisplayName As String = row("Task").ToString()
If Not row.IsNull("ReminderDateTime") Then
Dim reminderDateTime As DateTime = row("ReminderDateTime")
taskDisplayName = $"{reminderDateTime:(hh:mmtt)}".ToLower & $" {taskDisplayName}"
End If
If Not row.IsNull("RepeatedDays") Then
taskDisplayName = $"{taskDisplayName} {GlobalResources.repeatedTaskIndicator}"
End If
' Format due date
If Not row.IsNull("DueDate") Then
Dim dueDate As DateTime = row("DueDate")
If dueDate = DateTime.Today Then
taskDisplayName = $"(Today) {taskDisplayName}"
Else
taskDisplayName = $"{dueDate:(dd/MM)} {taskDisplayName}" ' Adds due date in dd/MM format
End If
End If
Dim taskItem As New TaskItem(taskDisplayName, row("TaskID"), row("IsDone") <> 0)
Important_CheckedListBox.Items.Add(taskItem, taskItem.IsDone)
Next
Important_CheckedListBox.EndUpdate() ' UI refresh happens once after all items are added
End Sub
#End Region
#Region "Task Properties Sidebar Management"
' Enum defining the different actions for managing the task properties sidebar.
Public Enum TaskPropertiesSidebarAction
DisableOnly
HideOnly
DisableAndHide
End Enum
' This method allows external components to disable or hide the task properties sidebar.
Public Sub DisableHide_TaskPropertiesSidebar(Optional action As TaskPropertiesSidebarAction = TaskPropertiesSidebarAction.DisableAndHide)
Select Case action
Case TaskPropertiesSidebarAction.DisableOnly
EnableOrDisable_TaskPropertiesSidebar(TaskPropertiesState.Disable)
Case TaskPropertiesSidebarAction.HideOnly
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Hide)
Case TaskPropertiesSidebarAction.DisableAndHide
EnableOrDisable_TaskPropertiesSidebar(TaskPropertiesState.Disable)
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Hide)
End Select
End Sub
Private Sub EnableOrDisable_TaskPropertiesSidebar(State As TaskPropertiesState)
Select Case State
Case TaskPropertiesState.Disable
TaskTitle_TextBox.Text = Nothing
Label_TaskEntryDateTime.Text = Nothing
Important_Button.BackgroundImage = GlobalResources.ImportantIcon_Disabled
DeleteTask_Button.BackgroundImage = GlobalResources.DeleteIcon_Disabled
CustomButton_AddReminder.PictureBox1.Image = GlobalResources.ReminderIcon_Disabled
CustomButton_Repeat.PictureBox1.Image = GlobalResources.RepeatIcon_Disabled
CustomButton_AddDueDate.PictureBox1.Image = GlobalResources.DueDateIcon_Disabled
If SettingsCache.ColorScheme = "Dark" Then
TaskTitle_TextBox.BackColor = Color.FromArgb(40, 40, 40)
Important_Button.BackColor = Color.Transparent
TaskDescription_RichTextBox.Hide()
Else
Important_Button.BackColor = Color.Transparent
End If
TaskTitle_TextBox.Enabled = False
TaskDescription_RichTextBox.Text = Nothing
TaskDescription_RichTextBox.Enabled = False
Label_ADT.Enabled = False
Label_TaskEntryDateTime.Enabled = False
Important_Button.Enabled = False
CustomButton_AddReminder.Enabled = False
CustomButton_AddReminder.ButtonText = TextPlaceholders.AddReminderButton
CustomButton_Repeat.Enabled = False
CustomButton_Repeat.ButtonText = TextPlaceholders.RepeatButton
CustomButton_AddDueDate.Enabled = False
CustomButton_AddDueDate.ButtonText = TextPlaceholders.DueDateButton
DeleteTask_Button.Enabled = False
Case TaskPropertiesState.Enable
If SettingsCache.ColorScheme = "Dark" Then
TaskTitle_TextBox.BackColor = Color.FromArgb(30, 30, 30)
Important_Button.BackColor = Color.FromArgb(21, 21, 21)
TaskDescription_RichTextBox.Show()
DeleteTask_Button.BackgroundImage = GlobalResources.DeleteIcon_White
CustomButton_AddReminder.PictureBox1.Image = GlobalResources.ReminderIcon_White
CustomButton_Repeat.PictureBox1.Image = GlobalResources.RepeatIcon_White
CustomButton_AddDueDate.PictureBox1.Image = GlobalResources.DueDateIcon_White
Else
Important_Button.BackColor = Color.FromArgb(234, 234, 234)
DeleteTask_Button.BackgroundImage = GlobalResources.DeleteIcon_Black
CustomButton_AddReminder.PictureBox1.Image = GlobalResources.ReminderIcon_Black
CustomButton_Repeat.PictureBox1.Image = GlobalResources.RepeatIcon_Black
CustomButton_AddDueDate.PictureBox1.Image = GlobalResources.DueDateIcon_Black
End If
TaskTitle_TextBox.Enabled = True
Label_ADT.Enabled = True
Label_TaskEntryDateTime.Enabled = True
Important_Button.Enabled = True
CustomButton_AddReminder.Enabled = True
CustomButton_Repeat.Enabled = True
CustomButton_AddDueDate.Enabled = True
TaskDescription_RichTextBox.Enabled = True
DeleteTask_Button.Enabled = True
End Select
End Sub
#End Region
' It updates the UI with the details of the selected task, including the task title, entry date/time, importance status,
' description, reminder time, and repeat frequency. If no task is selected, the task properties are disabled and cleared.
Private Sub LoadSelectedTaskProperties()
SelectedTask_Properties = TaskManager.GetTaskProperties(SelectedTask_ID, ImportantDT)
If SelectedTask_Properties Is Nothing Then
' Handle the case where task details are not found
MsgBox("Task details not found.")
Exit Sub
End If
' Cache task details to avoid multiple lookups
Dim title As String = SelectedTask_Properties.Title
Dim entryDateTime As String = SelectedTask_Properties.EntryDateTime
Dim isImportant As Boolean = SelectedTask_Properties.IsImportant
Dim taskDescription As String = SelectedTask_Properties.Description
Dim reminderDateTime As String = SelectedTask_Properties.ReminderDateTime
Dim repeatFrequency As String = SelectedTask_Properties.RepeatFrequency
Dim isRepeated As Boolean = SelectedTask_Properties.IsRepeated
Dim dueDate As String = SelectedTask_Properties.DueDate
' Enable task properties sidebar
EnableOrDisable_TaskPropertiesSidebar(TaskPropertiesState.Enable)
' Set task title
TaskTitle_TextBox.Text = title
' Set task entry date and time
Label_TaskEntryDateTime.Text = entryDateTime
' Update important icon
Important_Button.BackgroundImage = GlobalResources.ImportantIcon_Checked
' Disable or enable due date button based on task repetition
CustomButton_AddDueDate.Enabled = Not isRepeated
' Update task description
If String.IsNullOrEmpty(taskDescription) Then
TaskDescription_RichTextBox.ForeColor = Color.Gray
TaskDescription_RichTextBox.Text = TextPlaceholders.Description
Else
TaskDescription_RichTextBox.ForeColor = If(SettingsCache.ColorScheme = "Dark", Color.Pink, Color.Black)
TaskDescription_RichTextBox.Text = taskDescription
End If
' Update reminder button text
CustomButton_AddReminder.ButtonText = If(String.IsNullOrEmpty(reminderDateTime), TextPlaceholders.AddReminderButton, reminderDateTime)
' Update repeat button text
CustomButton_Repeat.ButtonText = If(String.IsNullOrEmpty(repeatFrequency), TextPlaceholders.RepeatButton, repeatFrequency)
' Update due date button text
CustomButton_AddDueDate.ButtonText = If(String.IsNullOrEmpty(dueDate), TextPlaceholders.DueDateButton, dueDate)
End Sub
#Region "Event Handlers"
' Event handler triggered when the user selects a task from the Planned_CheckedListBox.
Private Sub Important_CheckedListBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles Important_CheckedListBox.SelectedIndexChanged
SelectedTask_Index = Important_CheckedListBox.SelectedIndex
If SelectedTask_Index <> -1 Then
SelectedTask_Item = Important_CheckedListBox.SelectedItem
SelectedTask_ID = SelectedTask_Item.ID
LoadSelectedTaskProperties()
Else
DisableHide_TaskPropertiesSidebar(TaskPropertiesSidebarAction.DisableOnly)
End If
End Sub
Private Sub AddNewTask_TextBox_Enter(sender As Object, e As EventArgs) Handles AddNewTask_TextBox.Enter
EnableOrDisable_TaskPropertiesSidebar(TaskPropertiesState.Disable)
UiUtils.TaskSelection_Clear(Me.Important_CheckedListBox)
End Sub
Private Sub SubTlpTaskView_SubTlpTop_Click(sender As Object, e As EventArgs) Handles SubTlpTaskView_SubTlpTop.Click
EnableOrDisable_TaskPropertiesSidebar(TaskPropertiesState.Disable)
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Hide)
Me.ActiveControl = Nothing
UiUtils.TaskSelection_Clear(Me.Important_CheckedListBox)
End Sub
Private Sub SubTlpTaskView_SubTlpBottom_Click(sender As Object, e As EventArgs) Handles SubTlpTaskView_SubTlpBottom.Click
EnableOrDisable_TaskPropertiesSidebar(TaskPropertiesState.Disable)
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Hide)
Me.ActiveControl = Nothing
UiUtils.TaskSelection_Clear(Me.Important_CheckedListBox)
End Sub
Private Sub Important_Label_Click(sender As Object, e As EventArgs) Handles ImportantView_Label.Click
EnableOrDisable_TaskPropertiesSidebar(TaskPropertiesState.Disable)
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Hide)
Me.ActiveControl = Nothing
UiUtils.TaskSelection_Clear(Me.Important_CheckedListBox)
End Sub
' Add new task '
Private Sub AddNewTask_TextBox_KeyDown(sender As Object, e As KeyEventArgs) Handles AddNewTask_TextBox.KeyDown
If e.KeyValue = Keys.Enter Then
If String.IsNullOrWhiteSpace(AddNewTask_TextBox.Text) Then Exit Sub
TaskManager.AddNewTask(Me.AddNewTask_TextBox, Me.Important_CheckedListBox, ViewName.Important)
If Important_CheckedListBox.Items.Count = 1 Then
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Show)
End If
End If
End Sub
Private Sub DeleteTask_Button_Click(sender As Object, e As EventArgs) Handles DeleteTask_Button.Click
Me.ActiveControl = Nothing
If Important_CheckedListBox.SelectedIndex = -1 Or Important_CheckedListBox.Items.Count = 0 Or SelectedTask_Item Is Nothing Then
Exit Sub
End If
If SettingsCache.OnDeleteAskForConfirmation Then
Dim result As DialogResult = MessageBox.Show("Are you sure you want to proceed?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result <> DialogResult.Yes Then
Exit Sub
End If
End If
TaskManager.DeleteTask(SelectedTask_ID, Me.Important_CheckedListBox, SelectedTask_Index, ViewName.Important)
If Important_CheckedListBox.Items.Count = 0 Then
Me.ActiveControl = AddNewTask_TextBox
End If
End Sub
Private Sub Me_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
If e.KeyValue = Keys.Delete Then
DeleteTask_Button.PerformClick()
End If
End Sub
' ItemCheck event to change the 'IsDone' status of the selected task
Private Async Sub Important_CheckedListBox_ItemCheck(sender As Object, e As ItemCheckEventArgs) Handles Important_CheckedListBox.ItemCheck
If ViewsManager.isUiUpdating Then Exit Sub
' Store the current index before making changes
Dim previousIndex As Integer = SelectedTask_Index
' Update the task status based on the checkbox state
TaskManager.UpdateStatus(e.NewValue = CheckState.Checked, SelectedTask_ID)
If e.NewValue = CheckState.Checked Then
SFXPlayer.Play()
End If
Await Task.Delay(10)
UiUtils.TaskSelection_Clear(Important_CheckedListBox)
ViewsManager.RefreshTasks()
Me.ActiveControl = Me.AddNewTask_TextBox
End Sub
Private Sub CloseTaskProperties_Button_Click(sender As Object, e As EventArgs) Handles CloseTaskProperties_Button.Click
Me.ActiveControl = Nothing
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Hide)
End Sub
Private Sub Important_CheckedListBox_MouseDown(sender As Object, e As MouseEventArgs) Handles Important_CheckedListBox.MouseDown
If e.Button = MouseButtons.Right Then
MainWindow.ShowOrHide_TaskPropertiesSidebar(TaskPropertiesVisibility.Toggle)
End If
End Sub
Private Sub CustomButton_AddReminder_MouseClick(sender As Object, e As MouseEventArgs) Handles CustomButton_AddReminder.MouseClick
If e.Button = MouseButtons.Left Then
TaskManager.ShowReminderDialog(SelectedTask_ID, Me.Important_CheckedListBox)
ElseIf e.Button = MouseButtons.Right Then
UiUtils.ShowContextMenuCentered(Me.ContextMenuStrip1, Me.CustomButton_AddReminder)
End If
End Sub
Private Sub CustomButton_Repeat_MouseClick(sender As Object, e As MouseEventArgs) Handles CustomButton_Repeat.MouseClick
If e.Button = MouseButtons.Left Then
TaskManager.ShowRepeatDialog(SelectedTask_ID, Me.Important_CheckedListBox)
ElseIf e.Button = MouseButtons.Right Then
UiUtils.ShowContextMenuCentered(Me.ContextMenuStrip2, Me.CustomButton_Repeat)
End If
End Sub
Private Sub CustomButton_DueDate_MouseClick(sender As Object, e As MouseEventArgs) Handles CustomButton_AddDueDate.MouseClick
If e.Button = MouseButtons.Left Then
TaskManager.ShowDueDateDialog(SelectedTask_ID, SelectedTask_Index, Me.Important_CheckedListBox, ViewName.MyDay)
ElseIf e.Button = MouseButtons.Right Then
UiUtils.ShowContextMenuCentered(Me.ContextMenuStrip3, Me.CustomButton_AddDueDate)
End If
End Sub
Private Sub ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem1.Click
TaskManager.RemoveReminder(SelectedTask_ID, Me.Important_CheckedListBox, SelectedTask_Index)
End Sub
Private Sub ToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem2.Click
TaskManager.RemoveRepeat(SelectedTask_ID, Me.Important_CheckedListBox, SelectedTask_Index, ViewName.MyDay)
End Sub
Private Sub ToolStripMenuItem3_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem3.Click
TaskManager.RemoveDueDate(SelectedTask_ID, Me.Important_CheckedListBox, SelectedTask_Index, ViewName.MyDay)
End Sub
' Button event to change the 'IsImportant' status of the selected task
Private Sub Important_Button_Click(sender As Object, e As EventArgs) Handles Important_Button.Click
Me.ActiveControl = Nothing
If Important_CheckedListBox.SelectedIndex <> -1 Then
TaskManager.UpdateImportance(CheckState.Unchecked, SelectedTask_ID)
UiUtils.TaskSelection_Shift(Important_CheckedListBox, SelectedTask_Index, ViewName.Important)
If Important_CheckedListBox.Items.Count = 0 Then
UiUtils.TaskSelection_Clear(Important_CheckedListBox)
Me.ActiveControl = AddNewTask_TextBox
End If
Else
UiUtils.TaskSelection_Clear(Important_CheckedListBox)
Me.ActiveControl = AddNewTask_TextBox
End If
End Sub
Private Sub Important_View_Leave(sender As Object, e As EventArgs) Handles MyBase.Leave
UiUtils.TaskSelection_Clear(Important_CheckedListBox)
'MsgBox("Left Important view")
'MsgBox("SelectedItemIndex = " & Important_CheckedListBox.SelectedIndex)
End Sub
Private Sub TaskTitle_TextBox_KeyDown(sender As Object, e As KeyEventArgs) Handles TaskTitle_TextBox.KeyDown
If e.KeyValue = Keys.Enter Then
If TaskTitle_TextBox.Text Is String.Empty Then
ViewsManager.RefreshTasks()
Else
TaskManager.UpdateTitle(SelectedTask_ID, TaskTitle_TextBox.Text)
End If
Me.ActiveControl = Nothing
UiUtils.TaskSelection_Retain(Me.Important_CheckedListBox, SelectedTask_ID)
e.SuppressKeyPress = True
End If
End Sub
Private Sub TaskDescription_Enter(sender As Object, e As EventArgs) Handles TaskDescription_RichTextBox.Enter
If SettingsCache.ColorScheme = "Dark" Then
TaskDescription_RichTextBox.ForeColor = Color.White
ElseIf SettingsCache.ColorScheme = "Light" Then
TaskDescription_RichTextBox.ForeColor = Color.FromArgb(69, 69, 69)
End If
If TaskDescription_RichTextBox.Text = TextPlaceholders.Description Then
TaskDescription_RichTextBox.Text = String.Empty
End If
End Sub
Private Sub TaskDescription_KeyDown(sender As Object, e As KeyEventArgs) Handles TaskDescription_RichTextBox.KeyDown
' Check if Enter key is pressed
If e.KeyCode = Keys.Enter Then
' Check if Shift key is also pressed
If e.Shift Then
' Allow default behavior (new line)
Else
' Prevent the default behavior
e.SuppressKeyPress = True
TaskManager.UpdateDescription(SelectedTask_ID, TaskDescription_RichTextBox.Text)
Me.ActiveControl = Nothing
Important_CheckedListBox.SelectedIndex = SelectedTask_Index
End If
End If
End Sub
Private Sub Button_DeleteTask_MouseEnter(sender As Object, e As EventArgs) Handles DeleteTask_Button.MouseEnter
DeleteTask_Button.BackgroundImage = GlobalResources.DeleteIcon_Hover
End Sub
Private Sub Button_DeleteTask_MouseLeave(sender As Object, e As EventArgs) Handles DeleteTask_Button.MouseLeave
If SettingsCache.ColorScheme = "Dark" Then
DeleteTask_Button.BackgroundImage = GlobalResources.DeleteIcon_White
Else
DeleteTask_Button.BackgroundImage = GlobalResources.DeleteIcon_Black
End If
End Sub
#End Region
End Class