Skip to content

Commit 6ffd265

Browse files
committed
[Fix] Handle complete word deletion more reliably
1 parent 8af87ea commit 6ffd265

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed

Panels/Get_Ops/AppxPkgs/GetAppxPkgInfo.vb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,4 +602,18 @@ Public Class GetAppxPkgInfoDlg
602602
Next
603603
End If
604604
End Sub
605+
606+
Private Sub SearchBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles SearchBox1.KeyDown
607+
If e.KeyCode = Keys.Back And e.Control Then
608+
Dim text As String = SearchBox1.Text
609+
Dim lastSpaceIndex As Integer = text.LastIndexOf(" "c)
610+
If lastSpaceIndex > 0 Then
611+
SearchBox1.Text = text.Substring(0, lastSpaceIndex).TrimEnd()
612+
Else
613+
SearchBox1.Text = ""
614+
End If
615+
e.SuppressKeyPress = True
616+
SearchBox1.SelectionStart = SearchBox1.TextLength
617+
End If
618+
End Sub
605619
End Class

Panels/Get_Ops/Capabilities/GetCapabilityInfo.vb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,4 +567,18 @@ Public Class GetCapabilityInfoDlg
567567

568568
ListView1.Sort()
569569
End Sub
570+
571+
Private Sub SearchBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles SearchBox1.KeyDown
572+
If e.KeyCode = Keys.Back And e.Control Then
573+
Dim text As String = SearchBox1.Text
574+
Dim lastSpaceIndex As Integer = text.LastIndexOf(" "c)
575+
If lastSpaceIndex > 0 Then
576+
SearchBox1.Text = text.Substring(0, lastSpaceIndex).TrimEnd()
577+
Else
578+
SearchBox1.Text = ""
579+
End If
580+
e.SuppressKeyPress = True
581+
SearchBox1.SelectionStart = SearchBox1.TextLength
582+
End If
583+
End Sub
570584
End Class

Panels/Get_Ops/Drivers/GetDriverInfo.vb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,4 +1340,18 @@ Public Class GetDriverInfo
13401340
Next
13411341
End If
13421342
End Sub
1343+
1344+
Private Sub SearchBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles SearchBox1.KeyDown
1345+
If e.KeyCode = Keys.Back And e.Control Then
1346+
Dim text As String = SearchBox1.Text
1347+
Dim lastSpaceIndex As Integer = text.LastIndexOf(" "c)
1348+
If lastSpaceIndex > 0 Then
1349+
SearchBox1.Text = text.Substring(0, lastSpaceIndex).TrimEnd()
1350+
Else
1351+
SearchBox1.Text = ""
1352+
End If
1353+
e.SuppressKeyPress = True
1354+
SearchBox1.SelectionStart = SearchBox1.TextLength
1355+
End If
1356+
End Sub
13431357
End Class

Panels/Get_Ops/Features/GetFeatureInfo.vb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,4 +684,18 @@ Public Class GetFeatureInfoDlg
684684

685685
ListView1.Sort()
686686
End Sub
687+
688+
Private Sub SearchBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles SearchBox1.KeyDown
689+
If e.KeyCode = Keys.Back And e.Control Then
690+
Dim text As String = SearchBox1.Text
691+
Dim lastSpaceIndex As Integer = text.LastIndexOf(" "c)
692+
If lastSpaceIndex > 0 Then
693+
SearchBox1.Text = text.Substring(0, lastSpaceIndex).TrimEnd()
694+
Else
695+
SearchBox1.Text = ""
696+
End If
697+
e.SuppressKeyPress = True
698+
SearchBox1.SelectionStart = SearchBox1.TextLength
699+
End If
700+
End Sub
687701
End Class

Panels/Get_Ops/Pkgs/GetPkgInfo.vb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,4 +1539,18 @@ Public Class GetPkgInfoDlg
15391539
Next
15401540
End If
15411541
End Sub
1542+
1543+
Private Sub SearchBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles SearchBox1.KeyDown
1544+
If e.KeyCode = Keys.Back And e.Control Then
1545+
Dim text As String = SearchBox1.Text
1546+
Dim lastSpaceIndex As Integer = text.LastIndexOf(" "c)
1547+
If lastSpaceIndex > 0 Then
1548+
SearchBox1.Text = text.Substring(0, lastSpaceIndex).TrimEnd()
1549+
Else
1550+
SearchBox1.Text = ""
1551+
End If
1552+
e.SuppressKeyPress = True
1553+
SearchBox1.SelectionStart = SearchBox1.TextLength
1554+
End If
1555+
End Sub
15421556
End Class

0 commit comments

Comments
 (0)