1. Deva Shanmuga
  2. PowerBuilder
  3. Tuesday, 4 June 2024 15:04 PM UTC

Hi Experts,

I'd like to design a button with custom colors (background and text). While I can achieve this within a datawindow, it doesn't seem to work when I try it in a window. What should I do in such cases?

Thanks

Deva.S

John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 4 June 2024 15:41 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Deva -

Great answers from Andreas and Miguel! If I may provide a little additional explanation...

Everything you see displayed within a DataWindow Control is drawn by PowerBuilder, except for OLE objects. Since PB draws the button DWObject in a DataWindow, PB provides the developer with a lot of control over the button's appearance including its color.

The standard Command Button control is drawn by the Windows operating system as what is classified as a "common control". As supplied by Windows, the Command Button common control does not support alternative colors.

While I'm not 100% sure, I believe the PictureButton control is an enhanced control that PB provides by subclassing the standard Command Button control, so PB has provided it with the ability to set its color.

HTH - Best regards, John

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 4 June 2024 15:09 PM UTC
  2. PowerBuilder
  3. # 2

You can use a static text object. When clicking on it, you set the border to lowered for a short period and set it back to raised.

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 4 June 2024 15:08 PM UTC
  2. PowerBuilder
  3. # 3

Hi.

First of all you can try using picture button which allows you to use custom colors and see if you are satisfied with the result.

Andreas.

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 5 June 2024 15:01 PM UTC
Hi Andreas;

That is what I do as well - use a Picture Button instead utilizing various image(s) on the PB to give you the background effect(s) that you are looking for. ;-)

Regards .. Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.