tag:blogger.com,1999:blog-8670250487541922275.post4584235626223421379..comments2023-07-01T16:18:24.674+03:00Comments on Dotmad.Net: Five steps for creating a transparent user controlAdihttp://www.blogger.com/profile/04062010590444815988noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-8670250487541922275.post-25177072601677421852019-12-28T02:21:35.467+02:002019-12-28T02:21:35.467+02:00Reproduced the sample code and the result is my pa...Reproduced the sample code and the result is my panel is drawn with my PNG that has a transparent background, but everywhere that should be transparent is just black.<br /><br />The only thing that is different in my code is that I added code to the OnPaint method so that it draws the PNG I need it to draw:<br /><br /> protected override void OnPaint(PaintEventArgs e)<br /> {<br /> Graphics g = e.Graphics;<br /> g.Clear(Color.FromArgb(0, 0, 0, 0));<br /><br /> Bitmap bmp = new Bitmap(m_Image);<br /> bmp.MakeTransparent();<br /><br /> g.DrawImage(bmp, 0, 0,100,100);<br /> g.Dispose();<br /> }Joshhttps://www.blogger.com/profile/11306518220828028750noreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-40444702921703314512014-03-06T05:49:13.324+02:002014-03-06T05:49:13.324+02:00Panel&Label WinForms control with transparent ...<a href="http://www.kettic.com/winforms_ui/panels_labels.shtml" rel="nofollow">Panel&Label WinForms control with transparent support</a>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-38511639725229988992013-08-19T18:13:04.328+03:002013-08-19T18:13:04.328+03:00The original code works - brilliant!The original code works - brilliant!Hakannoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-88210050175297309592013-05-19T22:45:24.342+03:002013-05-19T22:45:24.342+03:00Can anyone explain how to make this work for a Pic...Can anyone explain how to make this work for a PictureBox?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-3657730651612382842012-03-22T21:55:00.123+02:002012-03-22T21:55:00.123+02:00and how do it for VB2010?
i have nice code, but is...and how do it for VB2010?<br />i have nice code, but is very slow:(<br />can anyone help please?Joaquimnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-87493978816069354702012-02-26T12:51:56.569+02:002012-02-26T12:51:56.569+02:00hi
now i am trying to create the user control in...hi <br /><br />now i am trying to create the user control in transparent i seen your code but i am not able to understand<br />so pls can you send the sample project for understanding<br /><br />Thanks & Regards<br />susiAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-49029987297235747452010-08-03T06:45:11.006+03:002010-08-03T06:45:11.006+03:00to avoid using RecreateHandle, and to reduce flick...to avoid using RecreateHandle, and to reduce flicker, in the containing form or other such container, add the this:<br /><br />(sorry only have a vb version offhand)<br /><br /><br /><br />Protected Overrides ReadOnly Property CreateParams As System.Windows.Forms.CreateParams<br /> Get<br /> Return SetCompositeStyle(MyBase.CreateParams)<br /> End Get<br />End Property<br /><br /><br />'-- place the following somewhere for reuse <br /><br />Public Function <br />SetCompositeStyle(ByRef cp As System.Windows.Forms.CreateParams) As System.Windows.Forms.CreateParams<br /> cp.ExStyle = cp.ExStyle Or ExtendedWindowStyles.WS_EX_COMPOSITED<br /> Return cp<br /> End Function<br /><br /><br />Public Enum ExtendedWindowStyles<br /> WS_EX_COMPOSITED = &H2000000<br /> WS_EX_APPWINDOW = &H40000<br /> WS_EX_ACCEPTFILES = &H10<br /> WS_EX_CLIENTEDGE = &H200<br /> WS_EX_CONTEXTHELP = &H400<br /> WS_EX_CONTROLPARENT = &H10000<br /> WS_EX_DLGMODALFRAME = &H1<br /> WS_EX_LAYERED = &H80000<br /> WS_EX_LAYOUTRTL = &H400000<br /> WS_EX_LEFTSCROLLBAR = &H4000<br /> WS_EX_LEFT = &H0<br /> WS_EX_LTRREADING = &H0<br /> WS_EX_MDICHILD = &H40<br /> WS_EX_NOACTIVATE = &H8000000<br /> WS_EX_NOINHERITLAYOUT = &H100000<br /> WS_EX_NOPARENTNOTIFY = &H4<br /> WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE Or WS_EX_CLIENTEDGE)<br /> WS_EX_RIGHT = &H1000<br /> WS_EX_RIGHTSCROLLBAR = &H0<br /> WS_EX_RTLREADING = &H2000<br /> WS_EX_STATICEDGE = &H20000<br /> WS_EX_TOOLWINDOW = &H80<br /> WS_EX_TOPMOST = &H8<br /> WS_EX_TRANSPARENT = &H20<br /> WS_EX_WINDOWEDGE = &H100<br /> End EnumAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-43399468212553880882010-07-26T16:45:35.208+03:002010-07-26T16:45:35.208+03:00how to implement this code? can anyone show me a s...how to implement this code? can anyone show me a sample of HOW-TO?<br />thanks✞ Đ ä ɳ ї ệ Ŀ ✈ ::https://www.blogger.com/profile/16890151530476279970noreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-28173540569874237372010-06-11T03:09:15.591+03:002010-06-11T03:09:15.591+03:00Thank you very very much for excellent article. Go...Thank you very very much for excellent article. God bless you.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-30048590090044164592010-01-28T17:41:55.488+02:002010-01-28T17:41:55.488+02:00Thanks a lot. I searched through all internet and ...Thanks a lot. I searched through all internet and most people don't know this trick. Good and easy.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-87142321376628101242009-10-06T16:45:54.680+02:002009-10-06T16:45:54.680+02:00Fantastic! Works with UserControl as well as a Pan...Fantastic! Works with UserControl as well as a Panel. Thanks a ton!Jeffhttps://www.blogger.com/profile/11966422995019330959noreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-26358796901535556732008-03-13T22:35:00.000+02:002008-03-13T22:35:00.000+02:00I want to thank you as well. Thanks!!!I want to thank you as well. Thanks!!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-51539090958534290322008-02-03T15:50:00.000+02:002008-02-03T15:50:00.000+02:00You are most welcome.You are most welcome.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-83539535776357904362008-02-03T15:49:00.000+02:002008-02-03T15:49:00.000+02:00You are most welcome.You are most welcome.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8670250487541922275.post-89525511910749899362008-01-31T10:24:00.000+02:002008-01-31T10:24:00.000+02:00Awesome! This actually worked, unlike the dozen ot...Awesome! This actually worked, unlike the dozen other solutions I found. Thanks!Anonymousnoreply@blogger.com