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

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top