The MASM Forum

General => The Campus => Topic started by: hfheatherfox07 on August 18, 2012, 08:53:39 AM

Title: How to Hide Button behind image or icon?
Post by: hfheatherfox07 on August 18, 2012, 08:53:39 AM
Hi there,
I was wondering how to hide a button behind an image or icon....
I can make this work with region only why  :( ?


Title: Re: How to Hide Button behind image or icon?
Post by: qWord on August 18, 2012, 10:34:04 AM
Quote from: hfheatherfox07 on August 18, 2012, 08:53:39 AMI was wondering how to hide a button behind an image or icon....
ShowWindow(hBtn,SW_HIDE) ?
Title: Re: How to Hide Button behind image or icon?
Post by: Antariy on August 18, 2012, 11:52:04 AM
Set a BS_OWNERDRAW window style to a button.


CONTROL "IDC_BTN",IDC_BTN1,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_CLIPSIBLINGS|WS_TABSTOP|BS_OWNERDRAW,12,12,36,18,WS_EX_OVERLAPPEDWINDOW
Title: Re: How to Hide Button behind image or icon?
Post by: hfheatherfox07 on August 18, 2012, 12:19:43 PM
Quote from: Antariy on August 18, 2012, 11:52:04 AM
Set a BS_OWNERDRAW window style to a button.


CONTROL "IDC_BTN",IDC_BTN1,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_CLIPSIBLINGS|WS_TABSTOP|BS_OWNERDRAW,12,12,36,18,WS_EX_OVERLAPPEDWINDOW


That leaves a static in the shape of the Button ....It does not show icon or bitmap that is there
Title: Re: How to Hide Button behind image or icon?
Post by: hfheatherfox07 on August 18, 2012, 12:50:27 PM
Quote from: qWord on August 18, 2012, 10:34:04 AM
Quote from: hfheatherfox07 on August 18, 2012, 08:53:39 AMI was wondering how to hide a button behind an image or icon....
ShowWindow(hBtn,SW_HIDE) ?

LOL

The Button Is hidden ...but wont work
Title: Re: How to Hide Button behind image or icon?
Post by: Antariy on August 18, 2012, 01:04:33 PM
Use static for a bitmap displaying - declare it in a RC file after button declaration.
Title: Re: How to Hide Button behind image or icon?
Post by: hfheatherfox07 on August 18, 2012, 01:11:12 PM
Oh Ok ....
That works but ...it breaks the image.... you meant add a static image  on top of the bottom right ?
Title: Re: How to Hide Button behind image or icon?
Post by: hfheatherfox07 on August 18, 2012, 01:17:38 PM
LOL Never Mind .....
I Got what you were saying
Thank you that works  :biggrin:
Title: Re: How to Hide Button behind image or icon?
Post by: Antariy on August 19, 2012, 09:02:36 AM
:t