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

MessageBar

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


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Topic: MessageBar
    Posted: 09 May 2008 at 2:41pm
Hello,
how can I be able to change the colored string in the messagebar in run-time:
 
Private Sub CreateMessageBar()
   
    Dim MessageBar As MessageBar
    Set MessageBar = CommandBars.MessageBar
    MessageBar.Visible = True
   
    MessageBar.AddCloseButton "close..."
   
    MessageBar.AddButton 1000, "Options...", "Show more options"
    MessageBar.Message = _
        "<StackPanel Orientation='Horizontal'>" & _
        "        <Image Source='10000'/>" & _
        "        <TextBlock Padding='3, 0, 0, 0' VerticalAlignment='Center'><Bold>Informations</Bold></TextBlock>" & _
        "        <TextBlock Padding='10, 0, 0, 0' VerticalAlignment='Center'>About the message.</TextBlock>" & _
        "</StackPanel>"
End Sub
 
thank you
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: 10 May 2008 at 4:27am
Hi,
 
You can replace Message string with new markup:
 
MessageBar.Message = _
        "<StackPanel Orientation='Horizontal'>" & _
        "        <Image Source='10000'/>" & _
        "        <TextBlock Padding='3, 0, 0, 0' VerticalAlignment='Center'><Bold>Informations</Bold></TextBlock>" & _
        "        <TextBlock Padding='10, 0, 0, 0' VerticalAlignment='Center' Foreground='Red'>About the message.</TextBlock>" & _
        "</StackPanel>"
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Bernie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 July 2007
Location: Taiwan
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bernie Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2008 at 10:29am
Try my Code:
 
Public Sub ShowMessage(ByVal MSG As String, Optional ByVal TextColor As String = "'Red'", Optional ByVal IsVisible As Boolean = True, Optional ByVal ButtonCaption As String)
      MSGBar.Message = "<StackPanel Orientation='Horizontal'><TextBlock Padding='8, 0, 0, 0' FontSize='12' Foreground='" & TextColor & "'>" & MSG & "</TextBlock></StackPanel>"
      MSGBar.Visible = IsVisible
      If ButtonCaption <> "" Then
            MSGBar.AddButton 801, ButtonCaption, ButtonCaption
      Else
            MSGBar.RemoveButtons
      End If
End Sub
Bernie Ho, Planning Manager + IELTS specialist + part-time programmer
Taiwan, R.O.C
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.172 seconds.