NicoVB Posted July 8, 2002 Posted July 8, 2002 Does anyone know where you can find examples of custom designed forms that do not look like normal forms in .NET. (an example: MSN explorer windows have a special look). Do you have to inherit from the Form object, but what then??? Quote Visit http://www.nico.gotdns.com Now ONLINE!
NicoVB Posted July 10, 2002 Author Posted July 10, 2002 There has to be such a things created by good people on the net :D Quote Visit http://www.nico.gotdns.com Now ONLINE!
Guest TheIrishCoder Posted July 11, 2002 Posted July 11, 2002 Do you mean custom shaped forms? If so there I can give you some code to do that if you wish. Quote
NicoVB Posted July 11, 2002 Author Posted July 11, 2002 Yes, I mean custom shaped forms. But with a selfmade titlebar. An other buttons for hiding, resizing and exiting the form. But the problem I have, is that when you set the formborderstyle from the form to: None, you have problems with resizing your form!!!. And that is not so very good. Quote Visit http://www.nico.gotdns.com Now ONLINE!
Guest TheIrishCoder Posted July 11, 2002 Posted July 11, 2002 Well the best way to create a shaped form is to use a bitmap or draw a shape with a graphics object, and set the rest of the form a uniform color set to transparent and as you say setting the formborderstyle to none. You can subclass the form to make windows think you are clicking on the titlebar when actually clicking on the form so that it can moved. You do this by overiding the WndProc method of the form class:- Protected Overides Sub WndProc(ByRef m As Message) MyBase.WndProc(m) If m.Msg = WM_NCHITTEST then If m.Result.ToInt32 = HTCLIENT then m.Result = New IntPtr(HTCAPTION) End If End If End Sub Now clicking anywhere on the form allows you to move it. I'm sure there is a way of implementing resizing but I'm not aware how to do it but quite often with a shaped form you might just not allow it to be resized. If you discover how to implement it you will have to resize the bitmap/graphics object at the same time. Quote
NicoVB Posted July 12, 2002 Author Posted July 12, 2002 Okay, thanks for this information, and i'll keep search for the resizing thing. But I think it should work with the MouseDown and MouseMove event. Quote Visit http://www.nico.gotdns.com Now ONLINE!
*Gurus* divil Posted July 12, 2002 *Gurus* Posted July 12, 2002 You'd be better advised to use TheIrishCoders method, rather than MouseMove etc events. Let Windows do its own moving. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
NicoVB Posted July 12, 2002 Author Posted July 12, 2002 Okay, but does this solve also the problem for really resizing the window by pulling in the corner of the form?? I thought TheIrishCoder only find a solution for the problem with the titlebar.. ?? Quote Visit http://www.nico.gotdns.com Now ONLINE!
*Gurus* divil Posted July 12, 2002 *Gurus* Posted July 12, 2002 That's right. I don't know how you'd use Windows resizing since you turned off the borders. You might have to do it manually. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
NicoVB Posted July 12, 2002 Author Posted July 12, 2002 Okay, now all is clear to me, so I will try to do this manually. Thanks all!! Quote Visit http://www.nico.gotdns.com Now ONLINE!
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.