Category / Section
How to set custom image in the WinForms RibbonControlAdv header?
1 min read
Custom image of ribbon header
You can render the custom image in the RibbonControlAdv Header. To set the custom header image in the RibbonControlAdv, do the following,
- Specify the RibbonHeaderImage property as the RibbonHeaderImage.Custom.
- Assign the required image to the RibbonControlAdv by using the CustomRibbonHeaderImage property.
C#
//Sets the custom image of the Ribbon Header. this.ribbonControlAdv1.RibbonHeaderImage = RibbonHeaderImage.Custom; //Assigns image in the Ribbon Header. this.ribbonControlAdv1.CustomRibbonHeaderImage = imageListAdv1.Images[0];
VB
'Sets the custom image of the Ribbon Header. Me.ribbonControlAdv1.RibbonHeaderImage = RibbonHeaderImage.Custom 'Assigns image in the Ribbon Header. Me.ribbonControlAdv1.CustomRibbonHeaderImage = imageListAdv1.Images(0)
Note:
The default value of the RibbonHeader image is specified as RibbonHeaderImage.None. So, specify the required image.
Figure 1: Before applying the custom header image in RibbonControlAdv
Figure 2: After applying the custom header image in RibbonControlAdv
Figure 3: Before applying the custom header image in BackStageView
Figure 4: After applying the custom header image in BackStageView
Samples: