Question

I have designed a circle here:

Private Sub HeatmapBande_Paint(sender As Object, e As ystem.Windows.Forms.PaintEventArgs)  Handles Me.Paint  
'draw a circle here  
End Sub

there is a radius(rayonZoneElectrodeEnCases) for the circle:

Public Property ProRayonZoneElectrodeEnCases() As Integer
    Get  
        Return rayonZoneElectrodeEnCases  
    End Get  
    Set(value As Integer)  
        rayonZoneElectrodeEnCases = value
        'reapint but how?????
    End Set  
End Property

what I need is: when we call the Property to change the radius like this: MyClass.ProRayonZoneElectrodeEnCases = 10, the circle will be repainted

I dont know what to do, can u help me?

thx in advance

Was it helpful?

Solution

If you use the Form's paint event to perform the drawing then add Me.Invalidate() into the properties' set method

Public Property ProRayonZoneElectrodeEnCases() As Integer
Get  
    Return rayonZoneElectrodeEnCases  
End Get  
Set(value As Integer)  
    rayonZoneElectrodeEnCases = value
    Me.Invalidate()
End Set  
End Property

This forces the form to refresh itself. See here: http://msdn.microsoft.com/en-us/library/system.windows.forms.control.invalidate%28v=vs.100%29.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top