예제 #1
0
        private void btnStringsPicker1_Click(
            object sender,
            EventArgs e)
        {
            var items = (new List<string>
            {
                "hello",
                "world",
                "tree hugging",
                "human hugging",
                "piece",
                "peice",
            }).ToArray();

            var f = new StringsPicker(
                Items: items,
                Title: "Pick an item",
                MultiSelect: true,
                InstantFilter: true,
                MatchFlags: StringsPicker.MatchingFlags.Basic | StringsPicker.MatchingFlags.StartsWith | StringsPicker.MatchingFlags.RegEx,
                DefaultMatchFlag: StringsPicker.MatchingFlags.StartsWith);

            if (f.ShowDialog() == DialogResult.OK)
            {
                foreach (string s in f.GetSelection())
                    Debug.WriteLine(s);
            }
        }
예제 #2
0
        private void btnStringsPicker3_Click(
            object sender, 
            EventArgs e)
        {
            var items = (new List<string>
            {
                "hello",
                "world",
                "tree hugging",
                "human hugging",
                "piece",
                "peice",
            }).ToArray();

            var f = new StringsPicker(
                Items: items,
                Title: "Pick an item",
                MultiSelect: true,
                InstantFilter: true,
                AllowFilter: false,
                SingleColumnList: true,
                Width: 400,
                Height: 700,
                FreeStyleValuesCaption: "Enter additional values (comma separated):",
                MatchFlags: StringsPicker.MatchingFlags.Basic | StringsPicker.MatchingFlags.StartsWith | StringsPicker.MatchingFlags.RegEx,
                DefaultMatchFlag: StringsPicker.MatchingFlags.StartsWith);

            //f.GetListView().Parent.Height = 600;
            if (f.ShowDialog() == DialogResult.OK)
            {
                var res = new List<string>(f.GetSelection());
                res.AddRange(
                    f.FreeStyleText.Split(new char[] { ',' }));

                foreach (string s in res)
                    Debug.WriteLine(s);
            }
        }