Change color of one button on click of second button

Posted by jasdeep on 22-May-2014 11:07

I am new to progress open edge. I am working on purely open edge progress application. User's requirement is to change color of button on click of second button.

How can this done ?Please suggest.

All Replies

Posted by Matt Gilarde on 22-May-2014 12:03

You can't change the color of a standard button on Windows (I'm assuming this is a GUI application). The only way I can think of to do this with pure ABL (no .NET or other third-party controls) is to use an image on the button and change the image to reflect the current state.

Posted by jasdeep on 22-May-2014 12:10

Thanks Matt. Yes it is a GUI application. It would be great if you could tell me the logic for changing image on button dynamically.

Posted by Matt Gilarde on 22-May-2014 12:27

The LOAD-IMAGE method allows you to display an image on a button.

Button1:LOAD-IMAGE("image.bmp").

OpenEdge supports several image formats, including BMP, JPG, and PNG, among others.

The button may be resized to fit the new image. If you want the button to stay the same size, turn off AUTO-RESIZE before loading the image.

Button1:AUTO-RESIZE = FALSE.

Posted by jasdeep on 22-May-2014 18:25

Thanks it worked. But I am facing another issue to fit the image in the button in compact form using load image parameter values. But it does not work.

Load-image("picture" ,[ , x-offset , y-offset , width , height ])

I tried different combinations but everytime the result is same.

1. btn_search:LOAD-IMAGE("C:\Users\Public\Pictures\Sample Pictures\Fat.bmp",7000 , 2550 ,105,35)

2. Using property values(height , width, x , y ) from the button.  

            btn_search:LOAD-IMAGE("C:\Users\Public\Pictures\Sample Pictures\Fat.bmp",700 , 255 ,105,35).

3. btn_search:LOAD-IMAGE("C:\Users\Public\Pictures\Sample Pictures\Fat.bmp")

Any idea how to resolve this.

Posted by Matt Gilarde on 22-May-2014 20:16

I'm not sure I understand what you're trying to do. Do you have a large image that you want to scale down so it fits on the button? The button widget doesn't scale the image. If the image is too large to fit on the button it will be cropped. The optional parameters on the LOAD-IMAGE method let you control the cropping of the image but there's no scaling.

Posted by Dileep Dasa on 22-May-2014 23:39

[mention:04e95b8bf7ad413db8577e7108735503:e9ed411860ed4f2ba0265705b8793d05], It will be helpful if you can post some screenshots that describe your problem

This thread is closed