(WORKAROUND) Task Dialog with ImageManager |
Post Reply |
Author | |
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
Posted: 16 February 2009 at 5:38am |
I have some icons loaded into an ImageManager control, on same Form as TaskDialog control, but I cannot get the Dialog to show icons from the Image Manager. Here is what I am trying:
TaskDialog.MainIcon = xtpTaskIconCustom TaskDialog.MainIconHandle = ImageManager.Icons.GetImage(100, 16).Handle The TaskDialog displays my text and works OK, but no icon. Can you tell me what is wrong? Thanks to Aaron for explaining I need to use an intermediate Object. |
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi Chris,
This will work:
Dim stdPic As Object 'See Note 1.
'Dim stdPic as StdPicture 'See Note 2.
Set stdPic = ImageManager.Icons.GetImage(0, 32).CreatePicture(xtpImageNormal) With wndTaskDialog .MainInstructionText = "Some text...." .MainIconHandle = stdPic.Handle .MainIcon = xtpTaskIconCustom .ShowDialog End With Note 1. //this will work also but: see post https://forum.codejock.com/forum_posts.asp?TID=12868
Note 2. //this will work also but: see post
With second option it isn't clear if this will support alpha images (first one doesn't), well see for yourself in post and maybe you will get a reply from support
|
|
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.... |
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
Thanks Aaron, that works fine.
I had previously tried dropping a PictureBox on the form and using: Set Picture1.Picture = ImageManager.Icons.GetImage(ID, 32).CreatePicture(xtpImageNormal) TaskDialog.MainIconHandle = Picture1.Image.Handle The PictureBox correctly displayed the icon, but TaskDialog did not. So as you suggest I tried using: Dim Pic as Object Set Pic = ImageManager.Icons.GetImage(ID, 32).CreatePicture(xtpImageNormal) ' Exactly same as above TaskDialog.MainIconHandle = Pic.Handle And TaskDialog now correctly shows the icon. :-) ?? I do not understand why my TaskDialog.MainIconHandle = ImageManager.Icons.GetImage(ID, 32).CreatePicture(xtpImageNormal).Handle does not work (ie. without going through the intermediate Object). Anyway, problem solved. THANK YOU Aaron. |
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
Additional Question.
It looks as if the TaskDialog always resizes the icon to a fixed size. I don't suppose there is any way to have larger icons displayed.....? |
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi Chris,
ImageManager contains only ONE Bitmap and that's why it returns always same handle. There's a post somewhere in CJ forum about this...
Well, it works for you (and me)
|
|
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.... |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi Chris,
I believe you can't assign images larger than 32x32.
|
|
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.... |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi Chris,
btw. Did you test it (what I previous wrote) with alpha images?
|
|
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.... |
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
But in the above I am getting Handle of GetImage.CreatePicture which is just a single image, so I would have thought it would be OK. But it doesn't work. However, if I assign GetImage.CreatePicture to an Object, and then use Handle of the Object, it works fine. Anyway it works, so I will not worry. All the images I have been using are 32bit alpha. Thanks again for your help. |
|
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
|
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 |