Click here to Skip to main content
15,848,483 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to send sms to mobile phone?? Pin
s4266-Jul-09 21:12
s4266-Jul-09 21:12 
QuestionVB6 vs VB.NET Windows Forms and Controls Handling Behavior Pin
QuickBooksDev25-Jun-09 7:25
QuickBooksDev25-Jun-09 7:25 
AnswerRe: VB6 vs VB.NET Windows Forms and Controls Handling Behavior Pin
Jon_Boy25-Jun-09 9:14
Jon_Boy25-Jun-09 9:14 
AnswerRe: VB6 vs VB.NET Windows Forms and Controls Handling Behavior Pin
dan!sh 25-Jun-09 9:15
professional dan!sh 25-Jun-09 9:15 
AnswerRe: VB6 vs VB.NET Windows Forms and Controls Handling Behavior Pin
Gideon Engelberth25-Jun-09 10:32
Gideon Engelberth25-Jun-09 10:32 
Questionproperty selected and load other items in other properties Pin
VB 8.025-Jun-09 5:01
VB 8.025-Jun-09 5:01 
AnswerRe: property selected and load other items in other properties Pin
Jon_Boy25-Jun-09 5:09
Jon_Boy25-Jun-09 5:09 
GeneralRe: property selected and load other items in other properties Pin
VB 8.026-Jun-09 3:22
VB 8.026-Jun-09 3:22 
Hi CP
This is my code i am retrieving a property value which raises the error


Public Class cTxtBoxProperties

        <Category("Misc")> <Description("Displays the type of data associated with the control")> _
    <TypeConverter(GetType(MyDataType))> _
    Public Property DataType()
        Get
            Return _DataType
        End Get
        Set(ByVal value As Object)          
            _DataType = value
        End Set
    End Property
    <Category("Misc")> <TypeConverter(GetType(NumberFormats))> _
    <Description("Displays the format of the control")> _
    Public Property Format() As String
        Get
            Return _Format
        End Get
        Set(ByVal value As String)
            _Format = value
        End Set
    End Property    
End Class
Dim tPropertyName As String = "DataType"
            Dim objTxt As Type = GetType(cTextBoxProperties)
            Dim PiInfo As PropertyInfo = objTxt.GetType.GetProperty("DataType")
            Dim ObjPropertyValue As Object = PiInfo.GetValue(objTxt, Nothing)



Public Class NumberFormats : Inherits System.ComponentModel.StringConverter

    Dim alist As New ArrayList
    Dim ControlNames() As String

    Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
        alist = New ArrayList
        alist = GetNumberFormats()
         ControlNames = CType(alist.ToArray(GetType(System.String)), String())
        Return New StandardValuesCollection(ControlNames)
    End Function

    Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
        Return True
    End Function

    Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
        Return True
    End Function

    Protected Friend Function GetNumberFormats() As ArrayList
        GetNumberFormats = Nothing
        Dim objFStream As FileStream = Nothing
        Dim objReader As StreamReader = Nothing
        Dim fiInfo As FileInfo = Nothing
        Dim tFontSizeFilePath As String = ""
        Dim tNumberFormats() As String
        Dim alist As New ArrayList
        Dim CTextbox As cTextBoxProperties = Nothing
        Dim tFileName As String = ""

        Try

'' Here Raising the ERROR 

            Dim tPropertyName As String = "DataType"
            Dim objTxt As Type = GetType(cTxtBoxProperties)
            Dim PiInfo As PropertyInfo = objTxt.GetType.GetProperty("DataType")
            Dim ObjPropertyValue As Object = PiInfo.GetValue(objTxt, Nothing)
         
<b>'' Here Raising the ERROR </b>          
                tFontSizeFilePath = String.Concat(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, tFileName)
            
            fiInfo = New FileInfo(tFontSizeFilePath)
            If fiInfo.Exists Then
                objFStream = New FileStream(tFontSizeFilePath, FileMode.OpenOrCreate, FileAccess.Read)
                objReader = New StreamReader(objFStream)
                While objReader.Peek <> -1
                    alist.Add(objReader.ReadLine.ToString.Trim)
                End While
                objReader.Close()
                objFStream.Close()
                Return alist
            Else
                MsgBox(tFileName & "is not existed in Application Path.")
                Exit Try
            End If
        Catch ex As Exception
            MsgBox("GetNumberFormats : " & Err.Description, MsgBoxStyle.Critical)
        Finally
            If Not fiInfo Is Nothing Then fiInfo = Nothing
            If Not objFStream Is Nothing Then objFStream = Nothing
            If Not objReader Is Nothing Then objReader = Nothing
            If Not CTextbox Is Nothing Then CTextbox = Nothing
            Erase tNumberFormats
        End Try

    End Function
End Class



Regards
Questionsoliworks image Pin
bhargava240925-Jun-09 3:04
bhargava240925-Jun-09 3:04 
AnswerRe: soliworks image Pin
Jon_Boy25-Jun-09 3:26
Jon_Boy25-Jun-09 3:26 
QuestionGDI+ problem? Pin
O.G.I.25-Jun-09 1:59
O.G.I.25-Jun-09 1:59 
AnswerRe: GDI+ problem? Pin
Thomas Krojer25-Jun-09 2:07
Thomas Krojer25-Jun-09 2:07 
AnswerRe: GDI+ problem? Pin
Dave Kreskowiak25-Jun-09 5:12
mveDave Kreskowiak25-Jun-09 5:12 
AnswerRe: GDI+ problem? Pin
O.G.I.25-Jun-09 5:20
O.G.I.25-Jun-09 5:20 
GeneralRe: GDI+ problem? Pin
Jon_Boy25-Jun-09 5:30
Jon_Boy25-Jun-09 5:30 
GeneralRe: GDI+ problem? [modified] Pin
Luc Pattyn25-Jun-09 5:36
sitebuilderLuc Pattyn25-Jun-09 5:36 
Questiontree view node click event Pin
bhargava240925-Jun-09 1:11
bhargava240925-Jun-09 1:11 
AnswerRe: tree view node click event Pin
dan!sh 25-Jun-09 2:11
professional dan!sh 25-Jun-09 2:11 
GeneralRe: tree view node click event Pin
bhargava240925-Jun-09 2:16
bhargava240925-Jun-09 2:16 
GeneralRe: tree view node click event Pin
Jon_Boy25-Jun-09 2:39
Jon_Boy25-Jun-09 2:39 
GeneralRe: tree view node click event Pin
bhargava240925-Jun-09 2:59
bhargava240925-Jun-09 2:59 
GeneralRe: tree view node click event Pin
bhargava240925-Jun-09 3:00
bhargava240925-Jun-09 3:00 
GeneralRe: tree view node click event Pin
Jon_Boy25-Jun-09 3:08
Jon_Boy25-Jun-09 3:08 
GeneralRe: tree view node click event Pin
bhargava240925-Jun-09 3:27
bhargava240925-Jun-09 3:27 
GeneralRe: tree view node click event Pin
dan!sh 25-Jun-09 2:59
professional dan!sh 25-Jun-09 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.