Winston Posted April 4, 2003 Posted April 4, 2003 (edited) hey guys in app i use the following code to paint a panel Dim g As Graphics = e.Graphics Dim tempRect As Rectangle = New Rectangle(0, 0, PANEL.Width, PANEL.Height) Dim tempBrush As System.Drawing.Drawing2D.LinearGradientBrush = _ New System.Drawing.Drawing2D.LinearGradientBrush(tempRect, COLOR1, COLOR2, System.Drawing.Drawing2D.LinearGradientMode.Horizontal) g.FillRectangle(tempBrush, tempRect) but wen i added a panel to my splash form it just doesnt paint any ideas why?... [edit]That code is not PHP...[/edit] Edited April 4, 2003 by Squirm Quote
*Gurus* divil Posted April 4, 2003 *Gurus* Posted April 4, 2003 Is this code in the Paint event of the panel? 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
Winston Posted April 4, 2003 Author Posted April 4, 2003 yeah it is i dun even know why theres a problem the splash forms border style is set to none and its not shown in the taskbar it center screen loaded on intiilize part of the frm main Quote
*Gurus* divil Posted April 4, 2003 *Gurus* Posted April 4, 2003 Are you giving it a chance to paint itself? How is it displaying at the moment? 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
Winston Posted April 4, 2003 Author Posted April 4, 2003 wat do u mean am i giving it a chance, it paints, and well its displayed in frmmain region code initilise bit using a system.threading.thead.sleep to close the form when its done.. Quote
*Experts* Volte Posted April 4, 2003 *Experts* Posted April 4, 2003 Your code works just fine for me. Try putting a MessageBox.Show("test') inside the Paint event just to ensure that it is actually firing. Perhaps the event is hooked up incorrectly. Quote
*Gurus* divil Posted April 4, 2003 *Gurus* Posted April 4, 2003 If you're showing the form, and using Thread.Sleep to wait, then hiding the form again it will never get a chance to paint itself. Try calling Application.DoEvents() just before you make it sleep. 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
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.