110,561
社区成员
发帖
与我相关
我的任务
分享
for (int i = 0; i < imageNode.ChildNodes.Count; i++)
{
name = Convert.ToString(imageTable.Rows[i]["name"]);
PictureBox pictureBoxX = new PictureBox();
pictureBoxX.Image = null;
Rectangle ScreenArea = System.Windows.Forms.Screen.GetBounds(this);
pictureBoxX.Width = ScreenArea.Width;
pictureBoxX.Height = ScreenArea.Height;
//pictureBoxX.Image = null;
imageFileName = "";
if (name != "")
{
imageFileName = dataFolder + @"\" + name;
buffer = File.ReadAllBytes(imageFileName);
memoryStream = new MemoryStream(buffer);
memoryStream.Seek(0, SeekOrigin.Begin);//20141013????
imageX = Image.FromStream(memoryStream);
pictureBoxX.Image = imageX;
}
picturefLPanel.Controls.Add(pictureBoxX);
}
foreach (System.IO.FileInfo file in files)
{
if (i3 >= 12)
{
MessageBox.Show("请清理不需要的快捷方式!");
break;
}
i3++;
WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut("C:\\Program Files\\Q test\\easy goto\\" + file.Name + "");
PictureBox pb = new PictureBox();
pb.Size = new Size(38, 34);
int k3;
if (i3 <= 6)
{
k3 = 61;
}
else
{
k3 = 2;
}
pb.Location = new Point((i3 % 6+1) * 100 - 60, k3);
pb.SizeMode = PictureBoxSizeMode.StretchImage;
pb.BackColor = Color.Transparent;
pb.Tag = file.Name;
pb.BorderStyle = BorderStyle.None;
panel22.Controls.Add(pb);
Label lb = new Label();
lb.BackColor = Color.Transparent;
lb.Font = new Font("Cambria", 7, FontStyle.Regular);
string k = file.Name.Remove(file.Name.Length - 8, 8);
if (k.Length <= 10)
{
lb.Text = k;
lb.Tag = file.Name;
}
else
{
lb.Text = k.Substring(0, 10)+"...";
lb.Tag = file.Name;
}
if (k.Length <= 6)
{
lb.Location = new Point(pb.Location.X -2, pb.Location.Y + 38);
}
else
{
lb.Location = new Point(pb.Location.X - 5, pb.Location.Y + 38);
}
lb.ForeColor = Color.White;
panel22.Controls.Add(lb);