Unplanned
Last Updated: 22 Apr 2024 12:29 by ADMIN
Hon
Created on: 22 Apr 2024 12:27
Category: PdfViewer
Type: Bug Report
0
RadPdfViewer: Text is not visible in the input text box control while VisualStudio2022Dark theme is applied

 

 

1 comment
ADMIN
Dinko | Tech Support Engineer
Posted on: 22 Apr 2024 12:29

Hello Hon,

Thank you for reporting this. As a workaround, you can get the RadTextBoxControlElement which represents the input text box, and change its ForeColor property. You can get this element with a mouse click event.

public partial class Form1 : RadForm
{
    public Form1()
    {
        InitializeComponent();
        this.radPdfViewer1.LoadDocument("../../example.pdf");
        this.radPdfViewer1.MouseClick += RadPdfViewer1_MouseClick;
    }

    private void RadPdfViewer1_MouseClick(object sender, MouseEventArgs e)
    {
        var textBoxControlElement = GetTextBoxControlElement(this.radPdfViewer1);
        if (textBoxControlElement != null)
        {
            if (textBoxControlElement.ForeColor != Color.White)
            {
                textBoxControlElement.ForeColor = Color.White;
            }
        }
    }
    private RadTextBoxControlElement GetTextBoxControlElement(MyPDFViewer myPDFViewer)
    {
        RadElement editor = null;

        foreach (RadFixedPageElement visualPage in myPDFViewer.PdfViewerElement.ViewElement.Children)
        {
            if (visualPage.Children.Count >= 1)
            {
                editor = visualPage.Children.FirstOrDefault();
            }
        }
        return editor as RadTextBoxControlElement;
    }
}

Regards,
Dinko | Tech Support Engineer
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.