我正在vb.net中创建一个任务对话框,图标没有出现。(其他一切工作)我正在使用microsoft . windowsapicodepack . dialog。我的代码如下:
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
我做错了什么吗
欢呼
目前,只有一种解决方法。您需要从打开的事件调用中设置它。像这样:
AddHandler yourTD.opened, AddressOf yourTD_Opened
并在某处添加如下内容:
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
欢呼。