B4J Question Change color of title bar/Form Title

Cassie

Member
Licensed User
Longtime User
Hi Guys,

How to change a background color of the Title Bar in form.

Thanks in advance.
 

stevel05

Expert
Licensed User
Longtime User
I'm trying it now as a I'm curious (and would like to use it). I'll let you know how I get on.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Thanks, I'm working on the resizing first.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Try this one created as a customview, I have tried to reproduce the Windows functionality, I don't have a mac, so can't emulate that. If you want to change it do look like Mac or Linux, it won't be very difficult. It's all done in a layout file.

The only two methods are Title, to set the title and Icon to set an icon. I've included my FormUtils so that setting the Icon, sets it as the item to show in the task bar.

Setting the colour, font sizes etc is done in the layout: TitleBar, The actual TitleBar colour is set as the Background for the TitleBarBG pane.

The only thing I haven't done is put a context menu on the icon, that's simple enough if you want to.

It would easily be possible to customize it as required. Let me know how you get on with it.
 

Attachments

  • TitleBar.zip
    20.1 KB · Views: 449
Last edited:
Upvote 0

stevel05

Expert
Licensed User
Longtime User
OK, version 2. The form wouldn't display after being unIconified. So it is now forced to redraw and it works OK.
 

Attachments

  • TitleBar2.zip
    20.2 KB · Views: 377
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Version 0.3 Removed both methods, setting title and Icon of form will update the titlebar and icon through Property listeners. No additional updating required.
Added focused border to match windows behaviour
Changed resizing of NE corner to behave like windows (i.e. reduced targeting area, therefore negated need for a timer).

Note: optimum height for titlebarcv on a layout is 39px, Horizontal anchors should be set to Both.
 

Attachments

  • TitleBar0-3.zip
    20.7 KB · Views: 443
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…