AlexMesquita
Active member
- Joined
- Jan 6, 2004
- Messages
- 29
I am using this code to paint my form with a gradient color, but when I open any window ( a messagebox, for example ), or a menu, over my Panel ( MyPanel), and close it, it draws a hole in my grandient color. Why?
[Broken External Image]:http://www.mundo.iol.pt/alexsander/jogos.consolas/imagens/Image1.jpg
The problem was solved.
Instead of using MyPanel.CreateGraphics(), I should be using e.Graphics.
Code:
Dim MyobjBrush As New Drawing2D.LinearGradientBrush _
(MyPanel.DisplayRectangle, Color.AliceBlue,Color.MediumSlateBlue, _
Drawing2D.LinearGradientMode.Horizontal)
Dim MyobjGraphics As Graphics = MyPanel.CreateGraphics()
objGraphics.FillRectangle(MyobjBrush, MyPanel.DisplayRectangle)
MyobjBrush.Dispose()
MyobjGraphics.Dispose()
The problem was solved.
Instead of using MyPanel.CreateGraphics(), I should be using e.Graphics.
Last edited by a moderator: