Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. property selected and load other items in other properties

property selected and load other items in other properties

Scheduled Pinned Locked Moved Visual Basic
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VB 8 0
    wrote on last edited by
    #1

    HI CP , Location : Areas, Countries , Capitals Item List : property selected in Location and load items in Item List I am having 1 property with drop down : Areas, Countries , Capitals suppose if i select the Areas then i have to load dynamically Areas thru the .txt file and if i clicked countries then i have to load dynamically and the same . How can i do this Dynamically ?? while clicking the particular item . Regards,

    J 1 Reply Last reply
    0
    • V VB 8 0

      HI CP , Location : Areas, Countries , Capitals Item List : property selected in Location and load items in Item List I am having 1 property with drop down : Areas, Countries , Capitals suppose if i select the Areas then i have to load dynamically Areas thru the .txt file and if i clicked countries then i have to load dynamically and the same . How can i do this Dynamically ?? while clicking the particular item . Regards,

      J Offline
      J Offline
      Jon_Boy
      wrote on last edited by
      #2

      If I'm following you correctly, each combo is dependent off another. I'm assuming you have some kind of a settings class (with related classes for the combo(s)?) that the property grid is set to. You could in the settings class, for each property set statement, parse the text files and update the values for the other properties as needed, which would update the values in the combo(s).

      "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

      V 1 Reply Last reply
      0
      • J Jon_Boy

        If I'm following you correctly, each combo is dependent off another. I'm assuming you have some kind of a settings class (with related classes for the combo(s)?) that the property grid is set to. You could in the settings class, for each property set statement, parse the text files and update the values for the other properties as needed, which would update the values in the combo(s).

        "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

        V Offline
        V Offline
        VB 8 0
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups