TaskDialog MainIconHandle |
Post Reply |
Author | |
jpcoffeyXXX
Groupie Joined: 16 August 2005 Location: United States Status: Offline Points: 31 |
Post Options
Thanks(0)
Posted: 04 February 2008 at 4:48pm |
I'm having a problem with the TaskDialog MainIconHandle. I'm trying to assign a 32 pixel icon to the TaskDialog MainIcon and it will not show. While I can get the icon to show using the API method provided in the example, I cannot see why CodeJock's own control cannot deliver the handle. The code I am using is,
Dim imgIcon As ImageManagerIcon, lngIconHandle As Long Dim td as TaskDialog Set imgIcons = MyForm.cjImageManagerIcons Set imgIcon = imgIcons.Icons.GetImage(ID_TASK_DIALOG_ICON, 32) lngIconHandle = imgIcon.Handle Set td = MyForm.cjTaskDialog With td .MainInstructionText = "CJ image handles do not work." .MainIcon = xtpTaskIconCustom .MainIconHandle = lngIconHandle .ShowDialog end with Set td = Nothing Set imgIcon = Nothing: Set imgIcons = Nothing The only thing showing up on the TaskDialog is the MainInstructionText. The image in the ImageManagerIcons is an XP icon with multiple sizes. Is there something I'm missing? Thanks for your help. Sincerely, John |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Yes it's a little strange that the control doesn't deliver the handle.
I also wanted to do simular what you wanted. This is what I found so far:
Dim stdPic As StdPicture
Set stdPic = ImageManager.Icons.GetImage(ID_TASK_DIALOG_ICON, 32).CreatePicture(xtpImageNormal) With taskDialog .MainInstructionText = "Some text...." .MainIconHandle = stdPic.Handle .MainIcon = xtpTaskIconCustom .ShowDialog End With |
|
jpcoffeyXXX
Groupie Joined: 16 August 2005 Location: United States Status: Offline Points: 31 |
Post Options
Thanks(0)
|
Aaron, thank you for the solution.
A caveat to everyone who is trying to accomplish the same thing, you cannot use an icon with an alpha channel with the StdPicture object. Initially when I implemented the solution it didn't work. After removing the icon with the alpha channel from the ImageManager and substituting an icon with 256 colors it worked beautifully. The weak link here is the StdPicture object which does not support icons with alpha channels. Again, Aaron thanks for your help. Sincerely, John |
|
McKloony
Senior Member Joined: 09 January 2007 Location: Germany Status: Offline Points: 340 |
Post Options
Thanks(0)
|
Yes, this works great. Do you know, if it is possible to set Icons bigger than 32 x 32? I tryed out with 48 x 48 icons and it was reduced to 32 x 32
|
|
Product: Xtreme SuitePro (ActiveX) 16.2.5
Platform: XP / Windows 7 Language: Visual Basic 6.0 SP6 |
|
jpcoffeyXXX
Groupie Joined: 16 August 2005 Location: United States Status: Offline Points: 31 |
Post Options
Thanks(0)
|
McKloony, I don't know if 48 x 48 icons will work. Sorry.
If not, it would be a limitation of the TaskDialog, but probably by design. When CodeJock created the TD control, I am sure they built it within the design specs supplied by Microsoft. Cheers, John |
|
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 |