Highlighted
Absent Member.
Absent Member.
2257 views

[archive] Flat Bitmap Button with nasty border

[Migrated content. Thread originally posted on 02 March 2009]

Does anyone know if there is a way to change the background color of a button?

I want to show a graphical flat button (button with a bitmap and flat value set to true, lines and size match the size of the bitmap 16x16 pixel) over a blue background but the default behavior draw a nasty gray border around the button.

regards
0 Likes
9 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Flat Bitmap Button with nasty border

Sorry, you can not change the color of a button, what you can do is to use a bitmap with the button. Find or make a bitmap with theappropriate color and use the bitmap property of the push button and wallah you have a coloer push button.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Flat Bitmap Button with nasty border

Sorry, you can not change the color of a button, what you can do is to use a bitmap with the button. Find or make a bitmap with theappropriate color and use the bitmap property of the push button and wallah you have a coloer push button.


Hi Dilbert,
I don't want to change the background of a normal button, but the color of the nasty border that the runtime draw around a bitmap button (a button with the bitmap property setted).
For example:
1- I've a frame with a light-blue background
2- I want to set a button with a icon bitmap (16x16 pixel) in the frame.
3- Set the button position and set the bitmap property
4- Set the lines (in pixel) and the size (in pixel) of the button to 16
5- set the flat style
The result it's a button with a gray border around the bitmap
The gray border it's my problem!
There is a way to remove the border or in alternative change the color of this border?

Thanks
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Flat Bitmap Button with nasty border

Can you post your example?

Did you use the transparency property when adding the bitmap to the push-button?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Flat Bitmap Button with nasty border

Can you post your example?

Did you use the transparency property when adding the bitmap to the push-button?


Hi,
I attach the screenshoot with a normal bitmap on a blue background and the same bitmap setted for a flat graphical button.

Can I add transparency to the button's bitmap? In wich way?

If it's impossible to change the border color of a graphical button can I change by Windows Api? in wich way?

Note: I use acucobol 7.0.1 and acucobol 7.2.0

Thanks in advance
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Flat Bitmap Button with nasty border

Here is tour.cbl with a toolbar and flat push button with a bitmap
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Flat Bitmap Button with nasty border

Here is tour.cbl with a toolbar and flat push button with a bitmap

Hi Dilibert,
thanks for your interest. With your sample I don't have problem because the toolbar have a gray background, but if I set another background color, the border appear around the bitmap.

Take a look at the sample picture in attachment.

I have attached your sample with a toolbar with different background.

Thanks
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Flat Bitmap Button with nasty border

Yep, I see the issue. I do not know of a work around on that.

Sorry
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Flat Bitmap Button with nasty border

Yep, I see the issue. I do not know of a work around on that.

Sorry


Don't worry.

Does anyone know another solution?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Flat Bitmap Button with nasty border

Hello,

I use a system to create a BMP gui, it's a little tricky, but you can do what you want. It's simple, put an image, a bitmap control and check if you click on it:

call "w$mouse" using get-mouse-status, mouse-info
end-call.
cancel "w$mouse".
compute mouse-row-pixel = mouse-row-pixel + 10.
compute mouse-col-pixel = mouse-col-pixel + 10.

inquire Bm-Cabecera1, line fi, column co, size an, lines al.
compute fi = fi * 10.
compute co = co * 10.
if (mouse-row-pixel >= fi and
mouse-row-pixel
(mouse-col-pixel >= co and
mouse-col-pixel
if panel1-open
set panel1-closed to true
else
set panel1-open to true
end-if
go Click_De_Raton_98_Panel_Derecho
end-if.

Bm-Cabecera1 its a Bitmap control used like a button, with that, you can create the gui that your imagination want. Yeah, maybe it's a bit cumbersome but really, the results are great.

basically, in the event link-to of my screen, i capture if the mouse was clicked, then, i inquire the positions of my bitmap/buttons and evaluate where was the click.

I hope this can be useful, best regards
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.