@@ -284,6 +284,7 @@ void FilterRecentProject(object sender, EventArgs e)
284
284
{
285
285
SetStatus ( "Filtering recent projects list ..." ) ;
286
286
string searchString = tbSearchBar . Text ;
287
+
287
288
foreach ( DataGridViewRow row in gridRecent . Rows )
288
289
{
289
290
if ( row . Cells [ "_project" ] . Value . ToString ( ) . IndexOf ( searchString , StringComparison . OrdinalIgnoreCase ) > - 1 )
@@ -295,6 +296,9 @@ void FilterRecentProject(object sender, EventArgs e)
295
296
row . Visible = false ;
296
297
}
297
298
}
299
+
300
+ lblClearSearchField . Visible = tbSearchBar . Text . Length > 0 ;
301
+
298
302
}
299
303
300
304
void FilterUnityUpdates ( object sender , EventArgs e )
@@ -846,6 +850,7 @@ private void Form1_KeyPress(object sender, KeyPressEventArgs e)
846
850
if ( tabControl1 . SelectedIndex == 0 && tbSearchBar . Text != "" )
847
851
{
848
852
tbSearchBar . Text = "" ;
853
+ lblClearSearchField . Visible = false ;
849
854
}
850
855
else if ( tabControl1 . SelectedIndex == 3 && tbSearchUpdates . Text != "" )
851
856
{
@@ -864,6 +869,7 @@ private void Form1_KeyPress(object sender, KeyPressEventArgs e)
864
869
tbSearchBar . Focus ( ) ;
865
870
tbSearchBar . Text += e . KeyChar ;
866
871
tbSearchBar . Select ( tbSearchBar . Text . Length , 0 ) ;
872
+ lblClearSearchField . Visible = tbSearchBar . Text . Length > 0 ;
867
873
}
868
874
break ;
869
875
}
@@ -1454,5 +1460,20 @@ private void btnPlayerLogFolder_Click(object sender, EventArgs e)
1454
1460
}
1455
1461
}
1456
1462
}
1463
+
1464
+ private void lblClearSearchField_Click ( object sender , EventArgs e )
1465
+ {
1466
+ tbSearchBar . Text = "" ;
1467
+ }
1468
+
1469
+ private void lblClearSearchField_MouseEnter ( object sender , EventArgs e )
1470
+ {
1471
+ ( ( Label ) sender ) . ForeColor = Color . FromArgb ( 255 , 0 , 0 , 0 ) ;
1472
+ }
1473
+
1474
+ private void lblClearSearchField_MouseLeave ( object sender , EventArgs e )
1475
+ {
1476
+ ( ( Label ) sender ) . ForeColor = Color . FromArgb ( 128 , 128 , 128 , 128 ) ;
1477
+ }
1457
1478
} // class Form
1458
1479
} // namespace
0 commit comments