-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
629 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace L2ScriptMaker.Extensions | ||
{ | ||
public class SelectedItem | ||
{ | ||
public string Text { get; set; } | ||
public string Value { get; set; } | ||
} | ||
|
||
public static class WinFormsControlExtension | ||
{ | ||
public static void SelectItembyValue(this ComboBox comboBox, string value) | ||
{ | ||
comboBox.SelectedIndex = -1; | ||
|
||
SelectedItem foundItem = comboBox.Items.OfType<SelectedItem>().FirstOrDefault(a => a.Value == value); | ||
if (foundItem == null) return; | ||
|
||
comboBox.SelectedItem = foundItem; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.