1

I am creating a task dialog in vb.net and the icon is not coming up.(everything else works) i am using the Microsoft.WindowsAPICodePack.Dialogs. my code is below:

 Dim commandLink_Send = New TaskDialogCommandLink("btnShowAlternatives", "View Alternative Times", "Select an available time")
    Dim commandLink_Ignore = New TaskDialogCommandLink("buttonIgnore", "Go Back", "Go back to booking form")
    **td.Icon = TaskDialogStandardIcon.Shield**
    td.Caption = "Application Error"
    td.InstructionText = "Booking Clash"
    td.Text = "The application has found a clash in one more of the selected resources"
    td.Cancelable = False
    td.Controls.Add(commandLink_Send)
    td.Controls.Add(commandLink_Ignore)
    AddHandler commandLink_Send.Click, AddressOf eventHandlers.commandLink_send_click
    AddHandler commandLink_Ignore.Click, AddressOf eventHandlers.commandLink_ignore_click

Am i doing something wrong

Cheers

1 Answer 1

3

At the moment, there's only 1 workaround for this. You need to set it from the Opened event call. Something like this:

AddHandler yourTD.opened, AddressOf yourTD_Opened

And somewhere add something like this:

Private Shared Sub yourTD_Opened(ByVal sender As Object, ByVal e As System.EventArgs)
    yourTD.icon = TaskDialogStandardIcon.Shield
    'And if you prefer you could also
    'yourTD.FooterIcon = TaskDialogStandardIcon.whichevericonyouwant
End Sub

CHeers.

Sign up to request clarification or add additional context in comments.

1 Comment

If you came here looking for c# code like I did: taskDialog.Opened += delegate { taskDialog.Icon = TaskDialogStandardIcon.Error; };

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.