在ItemDataBound中FindControl(label,HyperLink) 定义字体的色彩!(:)简单的问题)

 1   If (e.Item.ItemType  =  ListItemType.AlternatingItem Or e.Item.ItemType  =  ListItemType.Item Or e.Item.ItemType  =  ListItemType.EditItem) Then
 2             Dim dc_name As HyperLink  =  CType(e.Item.FindControl( " dc_name " ), HyperLink)
 3             Select Case dc_name.Text
 4                 Case  " 新闻 "
 5                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #0000FF " )
 6                 Case  " 娱乐 "
 7                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #FF6600 " )
 8                 Case  " 体育 "
 9                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #FF6600 " )
10                 Case  " I T "
11                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #0000FF " )
12                 Case  " 体育 "
13                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #FF6600 " )
14                 Case  " 图片 "
15                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #FF0066 " )
16                 Case  " 文化 "
17                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #CC0000 " )
18                 Case  " 影音 "
19                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #CC00CC " )
20                 Case  " 生活 "
21                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #FF6600 " )
22                 Case  " 财经 "
23                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #009900 " )
24                 Case  " 军事 "
25                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #0000FF " )
26                 Case  " 技术 "
27                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #666666 " )
28                 Case  " 情感 "
29                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #FF0066 " )
30                 Case  " 游戏 "
31                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #FF6600 " )
32                 Case  " 商机 "
33                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #0000FF " )
34                 Case  " 就业 "
35                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #CC6600 " )
36                 Case  " 两性 "
37                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #FF0066 " )
38                 Case  " 体育 "
39                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #FF6600 " )
40                 Case  " 其他 "
41                     dc_name.ForeColor  =  dc_name.ForeColor.FromName( " #666666 " )
42             End Select

你可能感兴趣的:(label)