New to Telerik UI for WinForms? Download free 30-day trial

Peek Window

RadOfficeNavigationBar provides popup preview option for its elements when the mouse is over a them. This functionality is disabled by default. To enable it, you can set the EnablePeekPopup property to true.

WinForms RadOfficeNavigationBar Peek Window


this.radOfficeNavigationBar1.OfficeNavigationBarElement.EnablePeekPopup = true;


Me.radOfficeNavigationBar1.OfficeNavigationBarElement.EnablePeekPopup = True


To set a content for each peek window, we can use the PeekPopupOpening event. In the event handler, we have access to the current hovered RadPageViewItem and depending on it, we can set the Page.PeekPopupContent property. This property is of type Control.

The Peek Window will take the size of its content. This needs to be considered while using UserControl as a content of the Peek Window.


private void OfficeNavigationBarElement_PeekPopupOpening(object sender, Telerik.WinControls.UI.OfficeNavigationBar.RadPageViewPeekPopupEventArgs e)
{
    RadLabel content = new RadLabel();
    content.Text = e.Page.Item.Text;
    content.Font = new Font("Segoe UI Semibold", 27f);
    content.LoadElementTree();
    e.Page.PeekPopupContent = content;
}


Private Sub OfficeNavigationBarElement_PeekPopupOpening(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.OfficeNavigationBar.RadPageViewPeekPopupEventArgs)
    Dim content As RadLabel = New RadLabel()
    content.Text = e.Page.Item.Text
    content.Font = New Font("Segoe UI Semibold", 27F)
    content.LoadElementTree()
    e.Page.PeekPopupContent = content
End Sub


In the following image we can see the Peek Window content when it hosts a custom user control.

WinForms RadOfficeNavigationBar Custom Peek Window

See Also

In this article