mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
4a6e81ca88
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@422 21ef857c-d57f-4fe0-8362-d861dc6d29cd
49 lines
1.2 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|