Murray Brown
asked on
VB.net DataGridView image distorting
Hi
I have a DataGridView on a TabControl that distorts wheb I alternate tabs as
shown in the image. I use the code below to get a gradient effect behind the tab page.
Not sure why this happens.
Private Sub TabPage2_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.Paint EventArgs) Handles TabPage2.Paint
Try
Dim graphics As Graphics = e.Graphics()
Dim rectBrush As New System.Drawing.Rectangle(0 , 0, 310, 1200)
Dim brush As LinearGradientBrush
brush = New LinearGradientBrush(rectBr ush, Color.FromArgb(46, 100, 160), _
Color.White, LinearGradientMode.Horizon tal)
graphics.FillRectangle(bru sh, rectBrush)
Catch ex As Exception
End Try
End Sub
I have a DataGridView on a TabControl that distorts wheb I alternate tabs as
shown in the image. I use the code below to get a gradient effect behind the tab page.
Not sure why this happens.
Private Sub TabPage2_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.Paint
Try
Dim graphics As Graphics = e.Graphics()
Dim rectBrush As New System.Drawing.Rectangle(0
Dim brush As LinearGradientBrush
brush = New LinearGradientBrush(rectBr
Color.White, LinearGradientMode.Horizon
graphics.FillRectangle(bru
Catch ex As Exception
End Try
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER