CaptionText and ContentText font style.

4 posts, 0 answers
  1. wiquezada
    wiquezada avatar
    2 posts
    Member since:
    Nov 2016

    Posted 08 Nov Link to this post

    Hello,

    Hello,
    Is there a way to set font style; size, font family (with html option or another way) of Caption Text and ContentText?

    Kind regards...

  2. Dess
    Admin
    Dess avatar
    2196 posts

    Posted 09 Nov Link to this post

    Hello, William,

    Thank you for writing.  

    In order to customize a specific element in RadDesktopAlert, it would be useful to get familiar with the internal element structure: https://docs.telerik.com/devtools/winforms/desktopalert/structure

    You can specify the font to be used for RadDesktopAlert by using the following code snippet: 
    this.radDesktopAlert1.CaptionText = "New E-mail Notification";
    this.radDesktopAlert1.ContentText = "Hello Jack, I am writing to inform you " +
                                        "that the planning meeting scheduled for Wednesday has been postponed and" +
                                        "it will eventually be rescheduled, possibly for the next Tuesday";
     
    this.radDesktopAlert1.Popup.AlertElement.ContentElement.Font = new Font("Arial", 8f, FontStyle.Italic);
    this.radDesktopAlert1.Popup.AlertElement.CaptionElement.TextAndButtonsElement.TextElement.Font = new Font("Verdana", 14f, FontStyle.Italic);
    this.radDesktopAlert1.Show();



    I hope this information helps. Should you have further questions I would be glad to help.

     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. wiquezada
    wiquezada avatar
    2 posts
    Member since:
    Nov 2016

    Posted 09 Nov in reply to Dess Link to this post

    Dess,

    Thank you very much, the information was very helpful for me.

    One more question, is there any way to add padding to the Content Image?

     

    Kind Regards,

    William

  4. Dess
    Admin
    Dess avatar
    2196 posts

    Posted 13 Nov Link to this post

    Hello, William,    

    Thank you for writing back. 

    RadDesktopAlertElement is a derivative of LightVisualElement which displays the text and image. You can create a DockLayoutPanel and place two LightVisualElements, one for the image part and one for the text part. Thus, you can specify the desired Margin between the text and image parts. Here is a sample code snippet: 
    this.radDesktopAlert1.CaptionText = "New E-mail Notification";
    DockLayoutPanel dockPanel = new DockLayoutPanel();
    dockPanel.LastChildFill = true;
    dockPanel.StretchHorizontally = true;
     
    LightVisualElement imageElement = new LightVisualElement();
    imageElement.Image = Properties.Resources.send_email;
    imageElement.ImageLayout = ImageLayout.Zoom;
     
    LightVisualElement textElement = new LightVisualElement();
    textElement.Text = "<html><i><color= Red>You have 16 new email messages.";
    textElement.StretchHorizontally = true;
    textElement.TextAlignment = ContentAlignment.MiddleLeft;
    textElement.Margin = new System.Windows.Forms.Padding(10, 0, 0, 0);
     
    dockPanel.Children.Add(imageElement);
    dockPanel.Children.Add(textElement);
     
    this.radDesktopAlert1.Popup.AlertElement.ContentElement.Children.Add(dockPanel);
    this.radDesktopAlert1.Popup.AlertElement.ContentElement.TextAlignment = ContentAlignment.MiddleLeft;
    this.radDesktopAlert1.Popup.AlertElement.ContentElement.ImageAlignment = ContentAlignment.MiddleLeft;
    this.radDesktopAlert1.Show();

    I hope this information helps. If you have any additional questions, please let me know. 

     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top