I understand that, however that makes all the controls transparent as well. I would like to have the form as see-through but various icons on it completely opaque.
Originally posted by Pirate That shouldn't happen , can you show me your code ?
Really? That happens to me too! I thought it was normal. It has nothing to do with code, just paste controls on the form, and set the form's opacity.
Hmm, I did manage to achieve something like this before though, by drawing a transparent color onto the form. I'd completely forgotten how, I'll see if I can figure it out again.
You could use a second form with the transparencykey set to the backcolor of the form to make it inside. Then just place whatever controls you want to show up on the form and place it over the other one. Its kind of a pain in the ass because then you have to sync sizing and movement but it shouldn't be too bad if you can't find another way. I think this is what Hu Flung Dung is talking about.
What i did in one of my projects for this was adding a panel to the form and make that and whatever control inside it (ex. a picturebox) transparent and the rest of the form was solid.
Edits: I thoguht it was needless to say that to make a control, lets say that panel, transparent you have to set its BackColor to the TransparencyKey of your form.
However this kind of transparency is somehow flawed. If you have a video program running, for example Windows media player showing a video then the transparency is lost. Some graphic card drivers don't show the form transparent, even those certified by MS.
Last edited by Lunatic3; Oct 5th, 2003 at 05:00 PM.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
Originally posted by Lunatic3 However this kind of transparency is somehow flawed. If you have a video program running, for example Windows media player showing a video then the transparency is lost. Some graphic card drivers don't show the form transparent, even those certified by MS.
I imagine , this wouldn't happen when using these massive Transparency API Calls . .NET GDI+ still for trivial tasks I guess .
It seems that some graphic cards (like mine, S3 ProSavageDDR) does not properly support transparency at 32 bit color quality,and it should be 16 bit to work. But there rises another problem when you set it to 16 bit, and that is in this case(16 bit) transparent control does not receive mouse events, but it should.
I have sent a sample and will be glad if you check and see if on your machine the transparent button receives mouse events in 16 bit or not.
Thanks
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
Originally posted by Lunatic3 It seems that some graphic cards (like mine, S3 ProSavageDDR) does not properly support transparency at 32 bit color quality,and it should be 16 bit to work. But there rises another problem when you set it to 16 bit, and that is in this case(16 bit) transparent control does not receive mouse events, but it should.
I have sent a sample and will be glad if you check and see if on your machine the transparent button receives mouse events in 16 bit or not.
Thanks
It works on the form's title and on the button . Is that what you mean ?
I want you to check two things. If you set color quality to 16 bit,
1- Is the button transparent? 99.99999...% it sohuld be.
2- if transparent, can you click on it?
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
Originally posted by Lunatic3 I want you to check two things. If you set color quality to 16 bit,
1- Is the button transparent? 99.99999...% it sohuld be.
2- if transparent, can you click on it?
1-Yes, it's .
2-Exactly , no event raised .
OK , easy one , don't develop for 16bit computers . If a user's GC doesn't support 32bit , let him go to hell .
Originally posted by Lunatic3 What about in 32 bit?
I am sure in 32 bit, it should receive mouse click. But it's strange, is there anyone who can describe it for us?
What happens in 32Bit , is the opposite of 16Bit mode . not transparent but handle events .
Yes, it should be transparent. I did a project for one of my friends and it largely depended on this kind of transparency. We wanted a transparent but still clickable part on the form and I did it in this way. But i am getting confused by statments from MSDN.
Property Value
A Color that represents the color to display transparently on the form.
Remarks
When the TransparencyKey property is assigned a Color, the areas of the form that have the same BackColor will be displayed transparently. Any mouse actions, such as the click of the mouse, that are performed on the transparent areas of the form will be transferred to the windows below the transparent area. For example, if the client region of a form is made transparent, clicking the mouse on that area would send the event notification of the click to any window that is below it. If the color assigned to the TransparencyKey property is the same as any controls on the form, they also will be displayed transparently. For example, if you have a Button control on a form that has its TransparencyKey property set to SystemColors.Control, the control will be displayed transparently unless the BackColor property of the Button control is changed to a different color.
Windows 2000 Platform Note: Transparent windows and regions are only supported under the Windows 2000 operating system.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
To add to confusion, some controls like panels and groupboxes are transparent in 32 bit on my machine and still dont register mouse clicks. I am going crazy.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979