Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - TaskDialog built-in Question icon is missing!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TaskDialog built-in Question icon is missing!

 Post Reply Post Reply
Author
Message
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Topic: TaskDialog built-in Question icon is missing!
    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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2010 at 3:35pm
Hi,
 
You could use Markup to accomplish this Wink
 
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 Tongue)
 
 
 
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....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2010 at 5:02pm
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:

Quote

Question mark icons

  • Use the question mark icon only for Help entry points. For more information, see the Help entry point guidelines.
  • Don't use the question mark icon to ask questions. Again, use the question mark icon only for Help entry points. There is no need to ask questions using the question mark icon anyway—it's sufficient to present a main instruction as a question.
  • Don't routinely replace question mark icons with warning icons. Replace a question mark icon with a warning icon only if the question has significant consequences. Otherwise, use no icon.


Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2010 at 5:47pm
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
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2010 at 5:53pm
Originally posted by jpbro jpbro wrote:

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
 
 
Then, my problem isn't a problem. LOL
 
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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2010 at 9:19pm
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

Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 19 September 2010 at 4:12am
Originally posted by jpbro jpbro wrote:

When using Markup, you need to use the XAML <Hyperlink> tag instead of the HTML <A> tag.
 
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! Smile
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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 19 September 2010 at 4:40am
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....
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2010 at 12:14pm
Originally posted by Aaron Aaron wrote:

Both Icon and Text will be aligned at the top.      
 
Thank for reply.
Another tricks to add into my code. Smile
 
 
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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2010 at 2:15pm
On a side note, we added this for 13.4.1
 


Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 22 September 2010 at 7:43am
Originally posted by SuperMario SuperMario wrote:

On a side note, we added this for 13.4.1
 


 
Great!!! Clap
You understand my point-of-view. Smile
 
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).  Wink
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.
Smile
 
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.137 seconds.