Posted 22 March 2020, 9:57 am EST
Enhancement request. A TaskDialogCommonButtons.Ignore
Forums Home / ComponentOne / WinForms Edition
Posted by: kbj on 22 March 2020, 9:57 am EST
Posted 22 March 2020, 9:57 am EST
Enhancement request. A TaskDialogCommonButtons.Ignore
Posted 22 March 2020, 8:39 pm EST
Hi 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:
…\Documents\ComponentOne Samples\WinForms\v4.0\C1Win7Pack\CS\TaskDialogDemo
Is there any specific reason that you want this to be added in TaskDialogCommonButtons enumeration and what is the use-case?
Regards,
Prabhat Sharma.
Posted 23 March 2020, 1:35 am EST
in 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
Return td
End Function
Posted 23 March 2020, 10:12 pm EST
Hi 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.
Regards,
Prabhat Sharma.