找回密码
 立即注册

QQ登录

只需一步,快速开始

frank.zhang

社区贡献组

83

主题

4000

帖子

6万

积分

社区贡献组

积分
69459

活字格认证微信认证勋章元老葡萄

frank.zhang
社区贡献组   /  发表于:2015-2-17 10:29  /   查看:4158  /  回复:0
问题描述:用C1TileControl模拟Window8风格的文档浏览应用
问题解答:在模拟Windows 8样式布局时,C1TileControl提供多种选项,并根据选择内容自适应完成界面排布。这样就可以按组为单位自动平铺排列,设置任意尺寸。也可以使用停靠、堆叠或嵌套面板,并设置文本元素以及图像。

关键代码:
  1. Group GetDriveGroup(DriveType driveType)
  2.         {
  3.             string groupName = driveType.ToString();
  4.             foreach (Group group in itemTiles.Groups)
  5.             {
  6.                 if (group.Name == groupName)
  7.                 {
  8.                     return group;
  9.                 }
  10.             }
  11.             Group newGroup = new Group();
  12.             switch (driveType)
  13.             {
  14.                 case DriveType.CDRom:
  15.                     newGroup.Text = "CD/DVD";
  16.                     break;
  17.                 case DriveType.Fixed:
  18.                     newGroup.Text = "Fixed Disks";
  19.                     break;
  20.                 case DriveType.Network:
  21.                     newGroup.Text = "Network Drives";
  22.                     break;
  23.                 case DriveType.Ram:
  24.                     newGroup.Text = "RAM Disks";
  25.                     break;
  26.                 case DriveType.Removable:
  27.                     newGroup.Text = "Removable Devices";
  28.                     break;
  29.                 default:
  30.                     newGroup.Text = "Misc";
  31.                     break;
  32.             }
  33.             itemTiles.Groups.Add(newGroup);
  34.             newGroup.Name = groupName;
  35.             return newGroup;
  36.         }
复制代码



效果截图:


源码下载:
用C1TileControl模拟Window8风格的文档浏览应用示例

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部