从我的菜单中,我使用LinkButtons和Labels在Panel中动态创建面包屑跟踪。无论我做什么,我都无法正确包装。
将LinkButton样式的空格设置为“nowrap”时,面板不会自动换行文本。
Home > Chevy > Trucks > Silverado > Engineering Department > Fuel System
将LinkButton风格的空白区域设置为“正常”,它包装但不是我需要的。
Home > Chevy > Trucks > Silverado >
Engineering
Department >
Fuel
System
这就是我要找的:
Home > Chevy > Trucks > Silverado >
Engineering Department > Fuel System
这是我在选择菜单项时创建链接的代码隐藏。
Private Sub CreateLink(name As String, id As Integer)
Dim link As LinkButton
Dim lbl As Label
link = New LinkButton
link.Text = name
link.SkinID = id
link.Style.Add("white-space", "nowrap")
AddHandler link.Click, AddressOf Links_Click
BreadCrumbPanel.Controls.Add(link)
lbl = New Label
lbl.Text = ">"
BreadCrumbPanel.Controls.Add(lbl)
End Sub
答案 0 :(得分:0)
好吧,我最后将面板宽度设置为100%而不是固定,现在结果如下所示。这两种结果都不能满足我的需求。
结果A
Home > Chevy > Trucks > Silverado >
Engineering Department > Fuel System
结果B
Home > Chevy > Cars > Volt > Sales
Department > Information