Print Page | Close Window

Problem with MessageBar icon

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=10490
Printed Date: 27 September 2024 at 7:58am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem with MessageBar icon
Posted By: Fabian
Subject: Problem with MessageBar icon
Date Posted: 04 May 2008 at 10:12am
Hi
 
I tried the messageBar with the CJ sample. It works as long as I use the ID 32988 for the Warning-image. Any other ID doesn't work for me?!
 
In my own code I load an XCB file and then add all icons from a prepopulated ImageManager control with:
 
CommandBars1.Icons.AddIcons ImageManager1.Icons
 
If I try using an icon from this collection - ID 32988 or not - I never see any image in the MessageBar (Text and Buttons are OK). BTW: all icons are XP-icons with alpha channels.
 
Using: VB6 checked under Win2000 and WinVista
 
Any Idea???
 
Thanks in advance


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6



Replies:
Posted By: Oleg
Date Posted: 05 May 2008 at 2:17am
Hi,
 
See Markup caption - "<Image Source='32988'/>" it used '32988' - just replace it for id you need.
Problem only that Markup use Global ImageManager:
 
CommandBars.GlobalSettings.Icons.LoadIcon App.Path & "\res\Warning.ico", 32988, xtpImageNormal


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Fabian
Date Posted: 05 May 2008 at 11:09am
Sorry Oleg - I changed your RibbonBar sample as follows
 
I added an ImageManager and supply an 16x16 icon (XP/alpha, ID=32988)
 
CommandBars.GlobalSettings.Icons.AddIcons Imagemanager1.Icons
 
Silly enough - I see still the old warning icon from the original sample. I tried also to CommandBars.GlobalSettings.Icons.RemoveAll - nothing helps...
 
any idea?


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: Oleg
Date Posted: 06 May 2008 at 1:59am
Hi,
Attach your changes.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Aaron
Date Posted: 06 May 2008 at 3:06am
Hi,
 
This will work:
 
Const ID_IMAGE = 1
 
CommandBars.GlobalSettings.Icons.RemoveAll
CommandBars.GlobalSettings.Icons.LoadIcon <image path>, ID_IMAGE, xtpImageNormal
    
    MessageBar.Message = _
        "<Image Source= '" & ID_IMAGE & "'/>"
 
or
 
    MessageBar.Message = _
        "<Image Source= '1'/>"
 
 
Oleg, why can't ID_IMAGE replaced with a string ?
 

 


-------------
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....


Posted By: Fabian
Date Posted: 06 May 2008 at 8:02am
I simply change your .LoadIcon line with that mentioned in my last post. I need to load the icons from ImageManager because we won't load icons at run time.
 
Thanks for looking at it


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: Fabian
Date Posted: 06 May 2008 at 11:38am
Problem solved. I had to set GlobalSettings.Icons each time I load a new commandbar file (.XCB).
 
Thanks


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: enjay
Date Posted: 20 May 2008 at 8:25pm
I'm not convinced !
 

Set CommandBars1.GlobalSettings.Icons = Me.ImageManager1.Icons
 
doesn't work, so reusing ImageManager1 is not possible. I don't want to use file I/O for images at runtime in any cases.
 
Will there be a fix for this ? 
 
/EDIT
 
The evidence:

Dim ID_IMAGE As Long
Private Sub Form_Load()
    ID_IMAGE = 200
   
    ' --- following line makes trouble in Markup Image
    'Set CommandBars1.GlobalSettings.Icons = Me.ImageManager1.Icons
    ' to reproduce:
    ' 1) uncomment the above line
    ' 2) save project and close
    ' 3) reload project and start
    ' ---
   
    CommandBars1.GlobalSettings.Icons.RemoveAll
    CommandBars1.GlobalSettings.Icons.LoadIcon App.Path & "\info.ico", ID_IMAGE, xtpImageNormal
   
    With CommandBars1.MessageBar
        .Message = _
        "<StackPanel Orientation='Horizontal'>" & _
        "        <Image Height='16' Source='" & CStr(ID_IMAGE) & "'/>" & _
        "        <TextBlock Padding='3, 0, 0, 0' VerticalAlignment='Center'>ID_IMAGE=" & ID_IMAGE & "</TextBlock>" & _
        "</StackPanel>"
        .Visible = True
    End With
End Sub


-------------
SuitePro ActiveX User


Posted By: Oleg
Date Posted: 21 May 2008 at 1:29am
Hi,
 
try
 
CommandBars1.GlobalSettings.Icons.AddIcons Me.ImageManager1.Icons


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: enjay
Date Posted: 21 May 2008 at 5:02am
Using method AddIcons means twice the amount of memory usage, right ? (e.g. ImageManager1 already have 100 images) 

-------------
SuitePro ActiveX User



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net