منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : شرح جزء من كود
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم
المشاركة للاخ الكريم ابو رائد


الكود


كود :
<TypeConverter(GetType(UpNormal.UpNormalypeConverter))> _
<Editor(GetType(UpNormalTypeEditor), GetType(UITypeEditor))> _
Public Class UpNormal
    Inherits Properties


    Class UpNormalypeConverter
        Inherits ExpandableObjectConverter

        Public Overrides Function ConvertTo(ByVal context As ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destType As Type) As Object
            If destType Is GetType(String) AndAlso TypeOf value Is UpNormal Then
                Dim tmp As UpNormal = TryCast(value, UpNormal)
                Return tmp.Delta.X & ", " & tmp.Delta.Y
            End If
            Return MyBase.ConvertTo(context, culture, value, destType)
        End Function
    End Class

End Class
للرفع