Property Get being called??? Why?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This chunk of code are causing me grief. It puts the correct Text Display in
a ComboBox on a form depending on what is in the ImgFocus Property of a
Custom Control. But it is calling the GET() portion of a property that is
undesired. Any Idead?

Dim index As Integer
index = cmbSoftFocus.FindString(ImgEdit.ImgFocusAttrib)
'Note on above line of Code: Calls the Get Protion
'of imageEdit.ImgFocusAttrib This is Expected

cmbSoftFocus.SelectedIndex = index
' Note on above line of Code: for some reason calls
' the set portion of the ImgEdit.ImgFocusAttrib
' This is UnExpected and causes my Image to Render
' again which takes up valuable time

'''''ImgEdit Custom Class Property ImgFocusAttrib Code
dim lcFocusAttrib as String = "None"

Public Property ImgFocusAttrib() As String
Get
Me.Trackit("Getting Focus Attrib")
Return lcFocusAttrib
End Get

Set(ByVal Value As String)
Me.Trackit("Setting Focus Attrib")
lcFocusAttrib = Value
Me.DoImageRendering(True)

End Set


'''''ImgEdit Custom Class Private Function Trackit '' For Testing
Private Function Trackit(ByVal tcwhere As String) As Boolean
If Me.Selectable = False Then
MsgBox(tcwhere, MsgBoxStyle.OKOnly, "ImgEdit Cusotm Control")
End If
End Function
 
Bob said:
This chunk of code are causing me grief. It puts the correct Text Display in
a ComboBox on a form depending on what is in the ImgFocus Property of a
Custom Control. But it is calling the GET() portion of a property that is
undesired. Any Idead?

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
Back
Top