منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
كيفية رسم لون متدرج على أداة في الفورم - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : الأقسام التعليمية - المنتدى القديم (http://vb4arb.com/vb/forumdisplay.php?fid=90)
+--- قسم : مكتبة أكواد المنتدى (http://vb4arb.com/vb/forumdisplay.php?fid=111)
+---- قسم : مكتبة أكواد .net (http://vb4arb.com/vb/forumdisplay.php?fid=117)
+---- الموضوع : كيفية رسم لون متدرج على أداة في الفورم (/showthread.php?tid=6155)



كيفية رسم لون متدرج على أداة في الفورم - RaggiTech - 17-10-12

كاتب الموضوع : AhmedEssawy


كود :
Namespace DevDistrict.Sample
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Drawing.Drawing2D


Public Class GradientPanel
Inherits System.Windows.Forms.Panel

Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
Dim g As Graphics = e.Graphics
g.SmoothingMode = SmoothingMode.HighQuality
Dim gPath As GraphicsPath = New GraphicsPath
Dim r As Rectangle = New Rectangle(0, 0, Me.Width, Me.Height)
gPath.AddRectangle(r)
Dim lb As LinearGradientBrush = New LinearGradientBrush(r, Color.White, Color.Blue, LinearGradientMode.Vertical)
g.FillPath(lb, gPath)
End Sub
End Class
End Namespace