用C1TileControl模拟Window8风格的文档浏览应用
问题描述:用C1TileControl模拟Window8风格的文档浏览应用问题解答:在模拟Windows 8样式布局时,C1TileControl提供多种选项,并根据选择内容自适应完成界面排布。这样就可以按组为单位自动平铺排列,设置任意尺寸。也可以使用停靠、堆叠或嵌套面板,并设置文本元素以及图像。
关键代码:
Group GetDriveGroup(DriveType driveType)
{
string groupName = driveType.ToString();
foreach (Group group in itemTiles.Groups)
{
if (group.Name == groupName)
{
return group;
}
}
Group newGroup = new Group();
switch (driveType)
{
case DriveType.CDRom:
newGroup.Text = "CD/DVD";
break;
case DriveType.Fixed:
newGroup.Text = "Fixed Disks";
break;
case DriveType.Network:
newGroup.Text = "Network Drives";
break;
case DriveType.Ram:
newGroup.Text = "RAM Disks";
break;
case DriveType.Removable:
newGroup.Text = "Removable Devices";
break;
default:
newGroup.Text = "Misc";
break;
}
itemTiles.Groups.Add(newGroup);
newGroup.Name = groupName;
return newGroup;
}
效果截图:
源码下载:
用C1TileControl模拟Window8风格的文档浏览应用示例
页:
[1]