mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-25 20:59:39 +01:00
Initial
This commit is contained in:
36
Code/UI/UIUtils.cs
Normal file
36
Code/UI/UIUtils.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Flowframes.IO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Flowframes.UI
|
||||
{
|
||||
class UIUtils
|
||||
{
|
||||
public static void InitCombox(ComboBox box, int index)
|
||||
{
|
||||
if (box.Items.Count >= 1)
|
||||
{
|
||||
box.SelectedIndex = index;
|
||||
box.Text = box.Items[index].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool AssignComboxIndexFromText (ComboBox box, string text) // Set index to corresponding text
|
||||
{
|
||||
int index = box.Items.IndexOf(text);
|
||||
|
||||
if (index == -1) // custom value, index not found
|
||||
return false;
|
||||
|
||||
box.SelectedIndex = index;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user