TelerikHelper
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class TelerikHelper
Inheritance: objectTelerikHelper
Constructors
public TelerikHelper()
Properties
public static bool IsNet47OrHigher { get; }
public static bool IsWindows10AnniversaryUpdateOrHigher { get; }
public static bool IsWindows10CreatorsUpdateOrHigher { get; }
Gets a value indicating whether the current operating system is Windows 10 or higher.
public static bool IsWindows10OrHigher { get; }
true if the operating system is Windows 10, Windows 11, or higher; otherwise, false.
This property checks for Windows 10 by examining the build number (10240 or higher). It's useful for determining when Windows 10+ specific features like WinUI, modern theming, or enhanced DPI support can be used.
Gets a value indicating whether the current operating system is Windows 11.
public static bool IsWindows11 { get; }
true if the operating system is Windows 11; otherwise, false.
This property specifically detects Windows 11 by checking for build number 21996 or higher on Windows 10+ systems. It's useful for enabling Windows 11-specific features like rounded corners, new system sounds, or updated visual styles.
Gets a value indicating whether the current operating system is exactly Windows 7.
public static bool IsWindows7 { get; }
true if the operating system is Windows 7; otherwise, false.
This property specifically detects Windows 7 (version 6.1) and can be used for Windows 7-specific workarounds or feature enablement. Note that this returns false for Windows 7 SP1 or later service packs.
Gets a value indicating whether the current operating system is Windows 7 or higher.
public static bool IsWindows7OrHigher { get; }
true if the operating system is Windows 7 or a more recent version; otherwise, false.
This property checks for Windows 7 (version 6.1) or higher. It's useful for determining minimum OS requirements and enabling features that require Windows 7 APIs like improved taskbar integration, Aero effects, or enhanced touch support.
public static bool IsWindows7OrLower { get; }
Gets a value indicating whether the current operating system is Windows 8 or higher.
public static bool IsWindows8OrHigher { get; }
true if the operating system is Windows 8, Windows 8.1, Windows 10, Windows 11, or higher; otherwise, false.
This property checks the operating system version to determine compatibility with Windows 8 features and APIs. Windows 8 corresponds to version 6.2 or higher of the Windows NT platform.
Gets a value indicating whether the current operating system is Windows 8 or lower.
public static bool IsWindows8OrLower { get; }
true if the operating system is Windows 8 or an earlier version; otherwise, false.
This property is useful for determining when to avoid Windows 8.1+ specific features or APIs. It returns true for Windows 8 (version 6.2) and all earlier Windows versions.
Methods
Searches the control hierarchy tree and returns the first RadControl that parents the control provided. Otherwise returns null.
Get bounding rectangle around rotated one.
public static RectangleF GetBoundingRect(RectangleF rect, RadMatrix matrix)
Gets the actual theme used by the passed RadElement.
Gets the actual theme name in use. The theme is set with the following priority:
- ThemeResolutionService.ApplicationThemeName
- RadControl.ThemeName - it is passed as the method parameter
- ThemeResolutionService.ControlDefaultThemeName
Converts a base64-encoded string to a System.Drawing.Image object.
public static Image ImageFromString(string encodedImage)
The base64-encoded string representation of an image.
Returns:A System.Drawing.Image object created from the encoded string, or null if the input string is null or empty.
Exceptions:Thrown when the input string is not a valid base64 string.
Thrown when the decoded data does not represent a valid image format.
This method decodes a base64 string and creates an Image object from the resulting byte array. It handles various pixel formats and applies appropriate transformations:
- For 24bpp RGB images, creates a bitmap and makes magenta transparent
- For GIF images, returns the image as-is
- For other formats, converts to 32bpp ARGB format for better transparency support
The method properly disposes of intermediate resources to prevent memory leaks.
Converts a System.Drawing.Image object to a base64-encoded string representation.
public static string ImageToString(Image image)
The image to convert to a string representation.
Returns:A base64-encoded string representing the image, or an empty string if the input image is null.
This method serializes an image to a base64 string that can be stored or transmitted as text. The method preserves the original image format when possible:
- GIF images are saved in their original GIF format
- Other image types are converted to PNG format for better quality and transparency support
The resulting string can be converted back to an image using the ImageFromString(string) method. All intermediate resources are properly disposed to prevent memory leaks.
public static RotateFlipType MirrorRotateFlipType(RotateFlipType rotateFlip)
public static RectangleF PerformCenteredRotation(ref RadMatrix matrix, RectangleF bounds, float angle)
public static RectangleF PerformTopLeftRotation(ref RadMatrix matrix, RectangleF bounds, float angle)
Creates a StringFormat object configured for the specified content alignment.
public static StringFormat StringFormatForAlignment(ContentAlignment align)
The content alignment to configure the StringFormat for.
Returns:A StringFormat object with Alignment and LineAlignment properties set according to the specified ContentAlignment.
This method translates WinForms ContentAlignment values to appropriate StringFormat alignment settings for text drawing operations. The returned StringFormat can be used with GDI+ text drawing methods to achieve the desired text alignment.
Creates a RadSvgImage object from XML string.
public static RadSvgImage SvgImageFromString(string svgXml)
The XML representing the SVG image.
Returns:The created RadSvgImage object.
Converts a RadSvgImage object to a XML string.
public static string SvgImageToString(RadSvgImage svgImage)
The RadSvgImage object.
Returns: