CaptionText and ContentText font style.

6 posts, 0 answers
  1. wiquezada
    wiquezada avatar
    8 posts
    Member since:
    Nov 2016

    Posted 08 Nov 2017 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 | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3212 posts

    Posted 09 Nov 2017 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
    8 posts
    Member since:
    Nov 2016

    Posted 09 Nov 2017 in reply to Dess | Tech Support Engineer, Sr. 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 | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3212 posts

    Posted 13 Nov 2017 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.
  5. Kun
    Kun avatar
    35 posts
    Member since:
    Aug 2018

    Posted 15 Feb in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello Dess,

    Your method works great for me.

    And then I put the definition of dockpanel in the myform.designer.vb (because I can't do the same thing in design view), it also works.

    But since I modified something design in myform, the dockpanel part will be deleted automatically in myform.designer.vb.

    Is there a conflict somewhere between dockpanel and form design ?

     

    Thank you by advance.

  6. Dimitar
    Admin
    Dimitar avatar
    2715 posts

    Posted 18 Feb Link to this post

    Hi William,

    The code in is regenerated each time you open the designer or Visual Studio. Instead, you can add it in the form constructor or use the forms Load event. 

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Progress Telerik
    Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top