New to Telerik UI for WinFormsStart a free 30-day trial

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

C#
public class TelerikHelper

Inheritance: objectTelerikHelper

Constructors

C#
public TelerikHelper()

Properties

C#
public static bool IsNet47OrHigher { get; }
C#
public static bool IsWindows10AnniversaryUpdateOrHigher { get; }
C#
public static bool IsWindows10CreatorsUpdateOrHigher { get; }

Gets a value indicating whether the current operating system is Windows 10 or higher.

C#
public static bool IsWindows10OrHigher { get; }
Property Value:

true if the operating system is Windows 10, Windows 11, or higher; otherwise, false.

Remarks:

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.

C#
public static bool IsWindows11 { get; }
Property Value:

true if the operating system is Windows 11; otherwise, false.

Remarks:

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.

C#
public static bool IsWindows7 { get; }
Property Value:

true if the operating system is Windows 7; otherwise, false.

Remarks:

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.

C#
public static bool IsWindows7OrHigher { get; }
Property Value:

true if the operating system is Windows 7 or a more recent version; otherwise, false.

Remarks:

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.

C#
public static bool IsWindows7OrLower { get; }

Gets a value indicating whether the current operating system is Windows 8 or higher.

C#
public static bool IsWindows8OrHigher { get; }
Property Value:

true if the operating system is Windows 8, Windows 8.1, Windows 10, Windows 11, or higher; otherwise, false.

Remarks:

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.

C#
public static bool IsWindows8OrLower { get; }
Property Value:

true if the operating system is Windows 8 or an earlier version; otherwise, false.

Remarks:

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

C#
public static void AnimateWindow(IntPtr animatedControlHandle, int animationDuration, int dwFlags)
Parameters:animatedControlHandleIntPtranimationDurationintdwFlagsint
C#
public static bool CanProcessMnemonic(Control control)
Parameters:controlControlReturns:

bool

C#
public static bool CanProcessMnemonicNoRecursive(Control control)
Parameters:controlControlReturns:

bool

C#
public static Color ColorMixer(GradientStyles gradientStyle, int numberOfColors, float gradientPercent, float gradientPercent2, params Color[] colors)
Parameters:gradientStyleGradientStylesnumberOfColorsintgradientPercentfloatgradientPercent2floatcolorsColor[]Returns:

Color

C#
public static Color ColorMixer(params Color[] colors)
Parameters:colorsColor[]Returns:

Color

C#
public static bool ContainsMnemonic(string text)
Parameters:textstringReturns:

bool

C#
public static Control ControlAtPoint(Point point)
Parameters:pointPointReturns:

Control

C#
public static bool ControlIsReallyVisible(Control control)
Parameters:controlControlReturns:

bool

C#
public static Form CreateOutlineForm()
Returns:

Form

C#
public static Form CreateOutlineForm(Bitmap image, Color color)
Parameters:imageBitmapcolorColorReturns:

Form

C#
public static RadShimControl CreateOutlineForm1()
Returns:

RadShimControl

C#
public static RadShimControl CreateOutlineForm1(Bitmap image, Color color)
Parameters:imageBitmapcolorColorReturns:

RadShimControl

Searches the control hierarchy tree and returns the first RadControl that parents the control provided. Otherwise returns null.

C#
public static RadControl FindRadControlParent(Control control)
Parameters:controlControlReturns:

RadControl

Get bounding rectangle around rotated one.

C#
public static Rectangle GetBoundingRect(Rectangle rect, RadMatrix matrix)
Parameters:rectRectangle

Rectangle that is to be rotated

matrixRadMatrix
Returns:

Rectangle

Returns the bounding rectangle around the rectangle that is rotated according to the given matrix

C#
public static RectangleF GetBoundingRect(RectangleF rect, RadMatrix matrix)
Parameters:rectRectangleFmatrixRadMatrixReturns:

RectangleF

Gets the color of the pixel at the specified location on the screen.

C#
public static Color GetColorAtPoint(Point location)
Parameters:locationPoint

The location in screen coordinates to get the color for.

Returns:

Color

The color of the pixel at the specified location.

C#
public static ImageFormat GetImageFormat(Image img)
Parameters:imgImageReturns:

ImageFormat

C#
public static Stream GetStreamFromResource(Assembly assembly, string resourceUri)
Parameters:assemblyAssemblyresourceUristringReturns:

Stream

Gets the actual theme used by the passed RadElement.

C#
public static string GetThemeName(RadElement element)
Parameters:elementRadElementReturns:

string

Gets the actual theme name in use. The theme is set with the following priority:

  1. ThemeResolutionService.ApplicationThemeName
  2. RadControl.ThemeName - it is passed as the method parameter
  3. ThemeResolutionService.ControlDefaultThemeName
C#
public static string GetThemeName(string controlThemeName)
Parameters:controlThemeNamestringReturns:

string

Converts a base64-encoded string to a System.Drawing.Image object.

C#
public static Image ImageFromString(string encodedImage)
Parameters:encodedImagestring

The base64-encoded string representation of an image.

Returns:

Image

A System.Drawing.Image object created from the encoded string, or null if the input string is null or empty.

Exceptions:

FormatException

Thrown when the input string is not a valid base64 string.

ArgumentException

Thrown when the decoded data does not represent a valid image format.

Remarks:

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.

C#
public static string ImageToString(Image image)
Parameters:imageImage

The image to convert to a string representation.

Returns:

string

A base64-encoded string representing the image, or an empty string if the input image is null.

Remarks:

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.

C#
public static bool IsCompatibleDataSource()
Returns:

bool

C#
public static bool IsDarkTheme(string themeName)
Parameters:themeNamestringReturns:

bool

C#
public static bool IsInteger(Type type)
Parameters:typeTypeReturns:

bool

C#
public static bool IsMaterialTheme(string themeName)
Parameters:themeNamestringReturns:

bool

C#
public static bool IsMetroTouchTheme(string themeName)
Parameters:themeNamestringReturns:

bool

C#
public static bool IsNumericType(Type type)
Parameters:typeTypeReturns:

bool

C#
protected static bool IsPseudoMnemonic(char charCode, string text)
Parameters:charCodechartextstringReturns:

bool

Converts a key to string taking into account the currently selected keyboard layout.

C#
public static string KeyCodeToUnicode(Keys key)
Parameters:keyKeys

The key to convert.

Returns:

string

The string mapped to the provided key.

C#
public static RotateFlipType MirrorRotateFlipType(RotateFlipType rotateFlip)
Parameters:rotateFlipRotateFlipTypeReturns:

RotateFlipType

C#
public static RectangleF PerformCenteredRotation(ref RadMatrix matrix, RectangleF bounds, float angle)
Parameters:matrixRadMatrixboundsRectangleFanglefloatReturns:

RectangleF

C#
public static RectangleF PerformTopLeftRotation(ref RadMatrix matrix, RectangleF bounds, float angle)
Parameters:matrixRadMatrixboundsRectangleFanglefloatReturns:

RectangleF

C#
public static void ProcessStart(string fileName, bool useShellExecute)
Parameters:fileNamestringuseShellExecutebool
C#
public static void ProcessStart(string fileName)
Parameters:fileNamestring

Resizes an image to a new size.

C#
public static Image ResizeImage(Image source, Size size)
Parameters:sourceImage

The source image to resize.

sizeSize

The new size which will be used to resize the image.

Returns:

Image

A new resized image.

C#
public static void SetDropShadow(IntPtr hWnd)
Parameters:hWndIntPtr

Creates a StringFormat object configured for the specified content alignment.

C#
public static StringFormat StringFormatForAlignment(ContentAlignment align)
Parameters:alignContentAlignment

The content alignment to configure the StringFormat for.

Returns:

StringFormat

A StringFormat object with Alignment and LineAlignment properties set according to the specified ContentAlignment.

Remarks:

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.

C#
public static RadSvgImage SvgImageFromString(string svgXml)
Parameters:svgXmlstring

The XML representing the SVG image.

Returns:

RadSvgImage

The created RadSvgImage object.

Converts a RadSvgImage object to a XML string.

C#
public static string SvgImageToString(RadSvgImage svgImage)
Parameters:svgImageRadSvgImage

The RadSvgImage object.

Returns:

string

C#
public static string TextWithoutMnemonics(string text)
Parameters:textstringReturns:

string

C#
public static void TransformPoints(Point[] points, float[] elements)
Parameters:pointsPoint[]elementsfloat[]
C#
public static void TransformPoints(PointF[] points, float[] elements)
Parameters:pointsPointF[]elementsfloat[]
In this article
DefinitionConstructorsTelerikHelper()PropertiesIsNet47OrHigherIsWindows10AnniversaryUpdateOrHigherIsWindows10CreatorsUpdateOrHigherIsWindows10OrHigherIsWindows11IsWindows7IsWindows7OrHigherIsWindows7OrLowerIsWindows8OrHigherIsWindows8OrLowerMethodsAnimateWindow(IntPtr, int, int)CanProcessMnemonic(Control)CanProcessMnemonicNoRecursive(Control)ColorMixer(GradientStyles, int, float, float, params Color[])ColorMixer(params Color[])ContainsMnemonic(string)ControlAtPoint(Point)ControlIsReallyVisible(Control)CreateOutlineForm()CreateOutlineForm(Bitmap, Color)CreateOutlineForm1()CreateOutlineForm1(Bitmap, Color)FindRadControlParent(Control)GetBoundingRect(Rectangle, RadMatrix)GetBoundingRect(RectangleF, RadMatrix)GetColorAtPoint(Point)GetImageFormat(Image)GetStreamFromResource(Assembly, string)GetThemeName(RadElement)GetThemeName(string)ImageFromString(string)ImageToString(Image)IsCompatibleDataSource()IsDarkTheme(string)IsInteger(Type)IsMaterialTheme(string)IsMetroTouchTheme(string)IsNumericType(Type)IsPseudoMnemonic(char, string)KeyCodeToUnicode(Keys)MirrorRotateFlipType(RotateFlipType)PerformCenteredRotation(ref RadMatrix, RectangleF, float)PerformTopLeftRotation(ref RadMatrix, RectangleF, float)ProcessStart(string, bool)ProcessStart(string)ResizeImage(Image, Size)SetDropShadow(IntPtr)StringFormatForAlignment(ContentAlignment)SvgImageFromString(string)SvgImageToString(RadSvgImage)TextWithoutMnemonics(string)TransformPoints(Point[], float[])TransformPoints(PointF[], float[])
Not finding the help you need?
Contact Support