Why wouldnt my panel paint?

Winston

Junior Contributor
Joined
Jan 25, 2003
Messages
266
Location
Sydney, Australia
hey guys in app i use the following code to paint a panel



Visual Basic:
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]
 
Last edited by a moderator:
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
 
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..
 
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.
 
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.
 
Back
Top