Jump to content

Changing color of modal resizeable form's border and title bar


Tim

Recommended Posts

Hello,

 

I have a modal resizeable form in my project which looks like this:

 

post-2020-0-95922400-1520569891_thumb.png

 

I would like to change the color of the title bar and borders so it looks something like this:

 

post-2020-0-73995700-1520569900_thumb.png

 

The text in the title bar should also be changed to black.

 

I've been struggling to find a comprehensive answer in this forum (the fact that "border" and "color" are apparently banned words in the forum search doesn't help).

 

For example, i tried the technique in the following post:

 

http://forums.unigui.com/index.php?/topic/3799-form-border-color-change/&do=findComment&comment=49474

 

Which only affects the title bar:

 

post-2020-0-40154400-1520569908_thumb.png

 

Then i tried the technique in the following post:

 

http://forums.unigui.com/index.php?/topic/3799-form-border-color-change/&do=findComment&comment=49473

 

With the following result:

 

post-2020-0-65711100-1520569914_thumb.png

 

Any suggestions?

 

Many thanks

Tim

Link to comment
Share on other sites

Hi

 

Please add this to onCreate of Form.

with WebForm.JSInterface do
   begin
     JSAddListener('afterrender', JSFunction('sender','var me=sender; '+
                                             'me.header.el.setStyle({"background-color": "green"}); '+
                                             'me.header.el.setStyle({"background-image": "none"}); '+
                                             'me.header.titleCmp.el.setStyle({"color": "black"}); '+
                                             'me.el.setStyle({"border": "solid 3px green"}); '+
                                             'me.el.setStyle({"background-color": "green"});'));
     JSConfig('baseCls', ['x-panel']);
   end;

post-737-0-89870500-1520669204_thumb.png

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...