TaskDialog built-in Question icon is missing! |
Post Reply |
Author | |
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
Posted: 18 September 2010 at 1:04pm |
TaskDialog is a great control.
Normally, TaskDialog is used to ask something to the user.
Then I not understand: why question icon is missing?
If I want disaply a question icon, i'm forced to load icons from file, so I'm forced to distribute in my application the related image file.
It's possible to add question icon to a built-in icons set?
Or, it's possible load icon from IconManager, instead to load from file?
Thank.
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
You could use Markup to accomplish this
The images in TaskDialog are images of an ImageManager.
The necessary code is also an image from ImageManager (just copy / paste code into textbox and saved it as image, just in case you are wondering the many different colors of the characters )
Just add your HELP icon (with same ID as Source=' ') to an ImageManager and
add following code:
XtremeSuiteControls.Icons.AddIcons Me.ImageManager1.Icons
With TaskDialog1 .EnableMarkup = True .ContentText = "<TextBlock><Image Source='1'/></TextBlock>" .ShowDialog End With |
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Microsoft changed their UI guidelines, and no longer recommend the use of the question mark icon (that's why it is missing). See:
http://msdn.microsoft.com/en-us/library/aa511277.aspx#questiongl Excerpt:
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Thank for your help, Aaron.
I have try your suggestion, unfortunately doesn't work correctly if I use EnableHyperlinks.
Example:
1. Open the Vista TaskDialog sample VB6.0 project of Codejock SuitePro (13.4.0)
2. Open frmMain, on General tab note that the Content textbox (editContent) contains this value:
"A TaskDialog presents <A HREF="executablestring 1">Hyperlink Text</A> information in a clear and consistent way."
The dialog display as below:
Now, in this project :
3. add the component CommandBars to the project
4. add ImageManager1 control to frmMain
5. add a question icon (32x32) to ImageManager1, with ID=100
If I use a simple plain text, as this:
taskDialog.ContentText = "<TextBlock><Image Source='100'/>This is a sample text</TextBlock>"
the result is good:
Now, I try to set the ContentText property to add custom icon to existing ContentText value:
taskDialog.ContentText = "<TextBlock><Image Source='100'/></TextBlock>" & editContent.text
the wrong result is show below:
Then, I have try to insert the editContent value into TextBlock:
taskDialog.ContentText = "<TextBlock><Image Source='100'/>" & editContent.text & "</TextBlock>"
again, the wrong result is:
What's wrong?
How I can to solve this problem?
Thank.
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Then, my problem isn't a problem.
Thank for this information.
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
When using Markup, you need to use the XAML <Hyperlink> tag instead of the HTML <A> tag.
There are some issues though. When a user clicks a XAML Hyperlink, the TaskDialog HyperlinkClicked event will be raised, but the URL property will be empty. This means that you can apparently have only 1 hyperlink per TaskDialog message, because there is no way to differentiate between them (or at least, I haven't figured out how to). Only CodeJock can solve this (by supporting the NavigateUri attribute of the Hyperlink tag, which they don't at this point, and passing that to the URL property of the HyperlinkClicked event), or by adding a MarkupContext object with AddHandler methods to the TaskDialog control (like the MarkupLabel and ReportControl have - this would allow us to perform our own link click handling). However, if you only need 1 hyperlink per message, then just wrap it in <Hyperlink></Hyperlink> tags and perform whatever action you require in the HyperlinkClicked event. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
This work good.
To apply your suggestion in VistaTaskDialog sample here the code
' replace <A> tag wiht <Hyperlink> tag in editContent.text control:
Dim newContentText As String newContentText = Replace(editContent.text, "<A HREF", "<Hyperlink Click") newContentText = Replace(newContentText, "</A>", "</Hyperlink>") taskDialog.ContentText = "<TextBlock><Image Source='100'/>" & newContentText & "</TextBlock>" The result isn't perfect (icon position is different from built-in icons of TaskDialog control), however it's a good way to use a custom icon from ImageManager, not from disk.
As you say, will hope that Codejock add support for NavigateUri attribute to allows us fo manage URL parameter of HyperlinkClicked event.
So i'm not foced to use a MarkupContext object.
Thank! |
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Use StackPanel to position Text & Icon seperately, something like this:
.ContentText = "<StackPanel Orientation='Horizontal'><Image Source='100'/><TextBlock>A TaskDialog presents....</TextBlock></StackPanel>"
Both Icon and Text will be aligned at the top.
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Thank for reply.
Another tricks to add into my code.
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
On a side note, we added this for 13.4.1
|
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Great!!!
You understand my point-of-view.
Now, I don't know it's possible, but should be also good if the 'custom icon' can be loaded icon from ImageManager, not only from file (as currently).
In this way:
1. I'm not forced to deploy additional icons files to use as custom icon.
2. the custom icon appear in correct position, on the left of Main text.
Actually, the icon loaded with Image Source of XAML <Hyperlink> tag or HTML <A> tag : <Image Source='100'/>
appear always on the left of Content text, not to the left of Main text when use built-in icons.
Thank again.
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |