otherside Posted October 18, 2003 Posted October 18, 2003 Hello guys again, I'm trying to make an application that has a look something like the media player. I created the background image, which is not square it has round corners. I set it to the form as background image and set the border style as none. The problem is that the empty areas of the background (trasparent canvas) the moment that runs are ok, but after you put it in the background by opening something else in front of it. these areas fill with what was in the background. this is what i mean http://www.otherside2k.pwp.blueyonder.co.uk/ Any Ideas how to get through this problem ? Quote
Hamburger1984 Posted October 19, 2003 Posted October 19, 2003 see attachment (C# and VB.NET Version included) I hope this is what you're looking for and my work was worth it... ;) Andreasshapedform.zip Quote
otherside Posted October 19, 2003 Author Posted October 19, 2003 Andreas, thanks , that's exactly what i was looking for thanks again man. Quote
otherside Posted October 19, 2003 Author Posted October 19, 2003 Can you explain a bit what this does ? (Not practically, i can see that it catches the move thing) but what these constants are etc. Private Const WM_NCHITTEST As Integer = &H84 Private Const HTCAPTION As Integer = &H2 Protected Overrides Sub WndProc(ByRef m As Message) If m.Msg = WM_NCHITTEST Then m.Result = New IntPtr(HTCAPTION) Else MyBase.WndProc(m) End If End Sub thanks again Quote
*Experts* Volte Posted October 19, 2003 *Experts* Posted October 19, 2003 WM_NCHITTEST is sent to a window when it wants to know specifically what part of the window you are moving over, clicking on, etc. When you return HTCAPTION like that, it's saying "I am clicking on the caption bar", which Windows associates with dragging, so it drags the window for you. Quote
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.