2020-08-16 21:06:22 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
2020-05-11 21:11:29 +08:00
|
|
|
|
|
|
|
|
|
namespace Sunny.UI.Demo
|
|
|
|
|
{
|
|
|
|
|
public partial class FListBox : UITitlePage
|
|
|
|
|
{
|
|
|
|
|
public FListBox()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Init()
|
|
|
|
|
{
|
|
|
|
|
uiListBox1.Items.Clear();
|
2020-08-22 11:45:41 +08:00
|
|
|
|
for (int i = 0; i < 50; i++)
|
2020-05-11 21:11:29 +08:00
|
|
|
|
{
|
|
|
|
|
uiListBox1.Items.Add(i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uiImageListBox1.Items.Clear();
|
|
|
|
|
string[] files = System.IO.Directory.GetFiles(DirEx.CurrentDir() + "Team",
|
|
|
|
|
"*.png", SearchOption.TopDirectoryOnly);
|
|
|
|
|
foreach (string file in files)
|
|
|
|
|
{
|
|
|
|
|
uiImageListBox1.AddImage(file, file.FileInfo().Name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void uiImageListBox1_ItemDoubleClick(object sender, System.EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.ShowInfoDialog(uiImageListBox1.SelectedItem.ImagePath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void uiCheckBox1_ValueChanged(object sender, bool value)
|
|
|
|
|
{
|
|
|
|
|
uiImageListBox1.ShowDescription = !uiImageListBox1.ShowDescription;
|
|
|
|
|
uiImageListBox1.ItemHeight = uiImageListBox1.ShowDescription ? 80 : 50;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void uiListBox1_ItemDoubleClick(object sender, System.EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.ShowInfoDialog(uiListBox1.SelectedItem.ToString());
|
|
|
|
|
}
|
2020-08-16 21:06:22 +08:00
|
|
|
|
|
|
|
|
|
private int num = 0;
|
|
|
|
|
private void uiButton1_Click(object sender, System.EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num);
|
|
|
|
|
num++;
|
|
|
|
|
}
|
2020-08-24 12:06:46 +08:00
|
|
|
|
|
|
|
|
|
private void uiButton1_DoubleClick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_double_" + num);
|
|
|
|
|
num++;
|
|
|
|
|
}
|
2020-05-11 21:11:29 +08:00
|
|
|
|
}
|
|
|
|
|
}
|