Files
mirror-processhacker/trunk/ProcessHacker/Forms/ListPickerWindow.cs
T
wj32 4a6e81ca88 Struct reader (with support for user-defined structs)
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@422 21ef857c-d57f-4fe0-8362-d861dc6d29cd
2008-12-25 10:27:35 +00:00

49 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ProcessHacker
{
public partial class ListPickerWindow : Form
{
public ListPickerWindow(string[] items)
{
InitializeComponent();
listItems.Items.AddRange(items);
if (listItems.Items.Count > 0)
listItems.SelectedItem = listItems.Items[0];
}
public string SelectedItem
{
get { return listItems.SelectedItem as string; }
}
private void buttonOK_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.OK;
this.Close();
}
private void buttonCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void listItems_SelectedIndexChanged(object sender, EventArgs e)
{
if (listItems.SelectedItem == null)
buttonOK.Enabled = false;
else
buttonOK.Enabled = true;
}
}
}