Style for WebToolBar and WebToolBarButton

Forgive my 1st attempt at a web page, but I’m struggling to set the foreground colour on my WebToolBar.

I can set the background colour ok. I actually don’t have any ‘text’ on the toolbar, just buttons, so the question should probably be how to set the foreground colour on a WebToolBarButton?

Thanks in advance.

It seems the ForegroundColor is being overwritten and won’t be applied. What colours do you want to use?, if you just want to set the background to something dark-ish and the foreground to white, you can use this code:

Me.Indicator = WebUIControl.Indicators.Dark
Me.Style.BackgroundColor = Color.Red

The dark indicator will use a white foreground colour by default.

2 Likes

Thanks Ricardo, I’ll try it out. :+1:

So far so good. :+1:

2 Likes

@Ken_Boyle you can set your Icon Colors in Toolbar.Opening like this:

// Plain Button for Item 2, Prefernces
Var prefsbtn As New WebToolbarButton
prefsbtn.style = WebToolbarButton.ButtonStyles.PushButton
prefsbtn.Caption = "Prefs"
prefsbtn.Tag = "2"
prefsbtn.Icon = webpicture.BootstrapIcon("gear-fill",&cffffff)
Me.AddItem(prefsbtn)
3 Likes

(Many) Thanks TT, will check it out … :ok_hand:

// Search Button
Var search As New WebToolbarButton
search.Icon = WebPicture.BootstrapIcon("search",&cffffff)
search.Caption = "Search"
search.Tag = "Search"
Me.AddItem(search)

That works! :+1:

Is it possible to change the Caption Text colour?
search.Caption.???
search.Style = ???

I do have this code (below) at the start of the DDREToolbarMain.Opening event handler, but I suspect the Me.Style.Foregroundcolor is only going to apply to any ‘text’ in the toolbar, not text associated with the button controls?

// Formatting
Me.Indicator = WebUIControl.Indicators.Dark
Me.Style.BackgroundColor = Color.RGB(0,51,102)
Me.Style.ForegroundColor = Color.RGB(255,255,255)

… consider the can-o-worms officially ‘OPEN’!! :rofl:

1 Like

It worked for me !! Thanks Ricardo :slight_smile:

1 Like