Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Problem with MessageBar icon
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with MessageBar icon

 Post Reply Post Reply
Author
Message Reverse Sort Order
enjay View Drop Down
Senior Member
Senior Member
Avatar

Joined: 31 March 2008
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote enjay Quote  Post ReplyReply Direct Link To This Post Topic: Problem with MessageBar icon
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 2008 at 1:29am
Hi,
 
try
 
CommandBars1.GlobalSettings.Icons.AddIcons Me.ImageManager1.Icons
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
enjay View Drop Down
Senior Member
Senior Member
Avatar

Joined: 31 March 2008
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote enjay Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
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: 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....
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2008 at 1:59am
Hi,
Attach your changes.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
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.086 seconds.