Posted 22 March 2020, 9:57 am ESTEnhancement request. A TaskDialogCommonButtons.Ignore
Enhancement request for C1TaskDialog
Posted by: kbj on 22 March 2020, 9:57 am EST
Replied 22 March 2020, 8:39 pm ESTHi Kingman,
You can add custom buttons in C1TaskDialog and use it as you like. You can go through the sample TaskDialogDemo in the product sample to know how it can be done.
The sample is located at:
Is there any specific reason that you want this to be added in TaskDialogCommonButtons enumeration and what is the use-case?
Replied 23 March 2020, 1:35 am ESTin the below quick and dirty error message handler, I set the C1TaskDialog content based on the buttons chosen. It make more sense to me to have the C1TaskDialog TaskDialogCommonButtons "line up" with the buttons in Visual Studio (which most developers and users are familiar with).
Public Function getErrorMessage(ex As Exception,
Optional windowTitle As String = "Error",
Optional commonButtons As TaskDialogCommonButtons = TaskDialogCommonButtons.Retry Or TaskDialogCommonButtons.Cancel) As C1TaskDialog
Dim v = New classVectorGraphics
Dim td = New C1TaskDialog
td.CommonButtons = commonButtons
td.SizeToContent = True
td.StartPosition = TaskDialogStartPosition.CenterOwner
td.MainInstruction = ex.Message
td.WindowTitle = windowTitle
td.MainCustomIcon = v.getIcon(My.Resources.svgWarning, defaultLargeImageSizeInTwips)
Dim content As String = Nothing
If CBool(commonButtons And TaskDialogCommonButtons.Cancel) Then content = stringAdd(content, "Press Cancel to quit", vbCrLf)
If CBool(commonButtons And TaskDialogCommonButtons.Retry) Then content = stringAdd(content, "Press Retry to try again", vbCrLf)
If CBool(commonButtons And TaskDialogCommonButtons.Ok) Then content = stringAdd(content, "Press Ok to ignore the error")
td.Content = content
If Not IsNothing(ex.InnerException) Then td.ExpandedInformation = ex.InnerException.Message
Marked as Answer
Replied 23 March 2020, 10:12 pm ESTHi Kingman,
Sorry, but we can not "line up" the custom buttons like TaskDialogCommonButtons.
You can use the custom buttons only as shown in the output of the product sample "TaskDialogDemo" when clicking on the Custom Button Sample link.