PdfViewerToolbar UI for WPF

1 Answer 78 Views
PDFViewer
Gabriell
Top achievements
Rank 1
Gabriell asked on 07 Jul 2023, 08:27 AM

Hi

Is it posible to add a custom button to the pdfviewer toolbar in UI for WPF?

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dinko
Telerik team
answered on 07 Jul 2023, 12:53 PM

Hello Gabriell,

Thanks for contacting us.

It is possible to add a custom button to a pdfViewer toolbar in WPF. You can make it through the code behind.

private void toolbar_Loaded(object sender, RoutedEventArgs e)
{
	var toolBar = this.pdfToolBar.FindChildByType<RadToolBar>();
	var button = new RadButton()
	{
		Content = "Custom button",
		Background = Brushes.Red,
		HorizontalAlignment = HorizontalAlignment.Left,
		VerticalAlignment = VerticalAlignment.Stretch,
		Margin = new Thickness(2),
		Padding = new Thickness(0),
		HorizontalContentAlignment = HorizontalAlignment.Stretch,
		VerticalContentAlignment = VerticalAlignment.Center,
		IsBackgroundVisible = false
	};
	button.Click += Button_Click;
	toolBar.Items.Add(button);
}

Can you please try this and let me know if it helps?

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Gabriell
Top achievements
Rank 1
commented on 10 Jul 2023, 07:35 AM

Thanks a lot Dinko, that's exactly what I was looking for!

 

Regards
Kim

Tags
PDFViewer
Asked by
Gabriell
Top achievements
Rank 1
Answers by
Dinko
Telerik team
Share this question
or