ComponentOne Windows 7 Control Pack for WinForms
Working with Windows 7 Control Pack for WinForms / Working with C1TaskDialog / C1TaskDialog Operating System Compatibility
In This Topic
    C1TaskDialog Operating System Compatibility
    In This Topic

    C1TaskDialog is only supported on Windows Vista or later. The control will simply not display on older versions of Windows and will not throw an exception. If the C1TaskDialog control is included in an application that may be run on previous versions of Windows – Windows XP, for example – you may want to specify an alternative dialog box so that important messages are displayed. You can do so by using the IsPlatformSupported property to detect the user's operating system.

    For example:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    If C1TaskDialog.IsPlatformSupported Then
        c1TaskDialog1.Show()
    Else
        ' Show a brief message with simple choice of the action
        Dim res As DialogResult = MessageBox.Show("Text", "Caption", MessageBoxButtons.YesNoCancel)
        If res = DialogResult.Yes Then
            ....
        End If
    End If
    

    To write code in C#

    C#
    Copy Code
    if (C1TaskDialog.IsPlatformSupported)
        c1TaskDialog1.Show();
    else
    {
        // Show a brief message with simple choice of the action
        DialogResult res = MessageBox.Show("Text", "Caption", MessageBoxButtons.YesNoCancel);
        if (res == DialogResult.Yes)
        {
            ...
        }
    }