Leaders snarfblam Posted November 29, 2003 Leaders Posted November 29, 2003 (edited) I am trying to use the transparency key property of a borderless form with a bitmap as the background, as per the instructions in visual studio's help, to create a custom shaped form. The outcome is what it should be, visually. When I click on transparent regions within the form, however, they still receive events rather that passing them to the underlying forms (even though you can see through to the underlying windows where i am clicking). This behaivor is contrary to what should be expected according to visual studio's help. Are there any known bugs like this, or any workaround or anything of the sort? Edit: Also, when I use spy++, I can see in the outline of the window (using the find window tool) that the region includes the transparent areas. Edited November 29, 2003 by snarfblam Quote [sIGPIC]e[/sIGPIC]
*Experts* mutant Posted November 29, 2003 *Experts* Posted November 29, 2003 Using custom Regions would do the job but you will have much harder time setting up the region so it matches your bitmap. Quote
Leaders snarfblam Posted November 29, 2003 Author Leaders Posted November 29, 2003 I know custom regions would work the way its supposed to, but Ive done the same in the past (using vb6 and windows api) and the results were initially ugly and it took alot of work to get what I wanted. And then what if i wanted to change the shape of the form? Quote [sIGPIC]e[/sIGPIC]
Engine252 Posted November 29, 2003 Posted November 29, 2003 are you sure the color you defined is the same that is on the image becouls if you use a 32 bit bitmap that are a lot of colors and if are difine the color to be RGB(18; 45; 231) this not the same as rgb(18; 45; 232) witch is the same by the human eye. althou i did not use a bitmap i used a gif file as my bitmap in my case the behaviour did as it supposed to and the events were given to the underlying application maiby you should try it with another file format. good luck Quote
Hamburger1984 Posted November 30, 2003 Posted November 30, 2003 see attachment.... Andreasshapedform.zip Quote
Leaders snarfblam Posted December 3, 2003 Author Leaders Posted December 3, 2003 In response to Engine252: of course I picked the right color, it was showing up transparent, which I did say in my post. I'm not stupid, and i'm not a newbie, but I am insulted. And thanks for the link, Hamburger1984. It is a good solution to my problem. But what I was really looking for was the answer to my question: Are there any known bugs like this, or any workaround or anything of the sort? Quote [sIGPIC]e[/sIGPIC]
FartNocker Posted December 7, 2003 Posted December 7, 2003 Here is a known bug http://support.microsoft.com/default.aspx?scid=kb;en-us;822495 but then you have this other bug that they don't even know about. However, I have sent this message. This workaround works for the background. BUT� If there is a ListBox, TextBox, or ComboBox on the form anything within (or) on these controls that is BLACK becomes transparent. This includes BLACK text in the control. If BorderStyle is set to FixedSingle the border is transparent, and the little black arrows on the scroll bars also become transparent if there is enough text in the control to make them appear Quote
Leaders snarfblam Posted December 15, 2003 Author Leaders Posted December 15, 2003 Thanks a bunch fartnocker. I was aware of that bug. I was not aware of a workaround, though. I tried it and it solved my problem. One more time, many thanks to fartnocker. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.