BarItem.UseOwnFont Property
In This Article
OBSOLETE
Use the Appearance.
Gets or sets whether the item’s links are painted using the item’s own font (Appearance.Font).
Namespace: DevExpress.XtraBars
Assembly: DevExpress.XtraBars.v24.2.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
[Browsable(false)]
[DefaultValue(false)]
[DXCategory("Appearance")]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Use the Appearance.Options.UseFont property instead.")]
public virtual bool UseOwnFont { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Boolean | false | true if the item’s links are painted using the item’s own font; otherwise false. |
#Remarks
See the BarItem.OwnFont topic to learn more.
#Example
The following example highlights the hovered bar item with bold font.
- Create two fonts with different font styles -
Bold
andRegular
. - Handle the BarManager.HighlightedLinkChanged event. Use
e.Link
ande.PrevLink
parameters to switch fonts.
using DevExpress.XtraBars;
namespace Highlight-Hovered-BarItem {
public partial class Form1 : DevExpress.XtraEditors.XtraForm {
Font boldFont;
Font regularFont;
public Form1() {
InitializeComponent();
boldFont = new Font(barManager1.GetController().AppearancesBar.ItemsFont, FontStyle.Bold);
regularFont = new Font(barManager1.GetController().AppearancesBar.ItemsFont, FontStyle.Regular);
barManager1.HighlightedLinkChanged += BarManager1_HighlightedLinkChanged;
}
private void BarManager1_HighlightedLinkChanged(object sender, HighlightedLinkChangedEventArgs e) {
if (e.PrevLink != null && e.PrevLink.Bar == barBrowser)
e.PrevLink.Item.ItemAppearance.SetFont(regularFont);
if (e.Link != null && e.Link.Bar == barBrowser)
e.Link.Item.ItemAppearance.SetFont(boldFont);
}
}
}
See Also