Android Question [Solved] Is posible to know the name of an object by code?

Discussion in 'Android Questions' started by cds-soft, Feb 2, 2015.

  1. cds-soft

    cds-soft Member Licensed User

    Well, it could be an stupid question, but i didn't found the way of know the name of an object by code.

    My case: I'm sharing one event between 4 edittexts with the casting tecnic.
    Code:
    Sub edHour_FocusChanged (HasFocus As Boolean)
        
    If HasFocus Then
            
    Dim ed As EditText
            
    Dim sTag As String
            ed = 
    Sender
            sTag = ed.Tag
            ShowHourDialog(ed, sTag)
        
    End If
    End Sub
    As you can see, I'm using the tag to know who rise the event.

    No problem, but for me should be easer to know Sender name, becuase if you forget to set tag by code or in design those edits soudn't work properly. For me it's a way to reduce errors in the future if i use this tecnic again.

    Thanks and sorry for my english.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Objects don't have names. The designer name property is only used to generate a variable to reference this object.
     
    Cableguy likes this.
  3. cds-soft

    cds-soft Member Licensed User

    Thanks for the info.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice