Hey all

Im having some trouble with some seemingly simple code

VB Code:
  1. Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  2.  
  3. If Design Then
  4.         Points(UBound(Points)).X = X
  5.         Points(UBound(Points)).Y = Y
  6.        
  7.         Dim handle As Long
  8.         Dim temp1 As Long
  9.        
  10.         Picture1.Cls
  11.         handle = Picture1.hdc
  12.         temp1 = Polygon(handle, Points(0), (UBound(Points) + 1))
  13.        
  14.         ReDim Preserve Points(UBound(Points) + 1) As POINTAPI
  15.    
  16.     End If
  17.  
  18. end sub

The code is fairly self explanatory but just incase: if the form is in design mode the user can click on the picture box area to form points of a polygon, after each click the polygon is redrawn.

Tracing the code shows no obvious errors, the array is fills up perfectly with coords and the polkygon api returns values of 1 which is non zero which suggests no errors. However nothing on the picture box is drawn!

Thanks in advance