这什么SetPixel 完全没成效

这什么SetPixel 完全没效果
这什么SetPixel 完全没效果

Private Declare Function SetPixel Lib "gdi32 " (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long

Private Sub Form_Load()
   SetPixel Me.hdc, 40, 40, &HFF
   MsgBox ""
End Sub


------解决方案--------------------
AutoRedraw属性设置为True
或者在Form_Paint事件中使用SetPixel Me.hdc, 40, 40, &HFF(对应于AutoRedraw属性为false才有Paint事件)

------解决方案--------------------
不能放到Load中

Private Declare Function SetPixel Lib "gdi32 " (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long

Private Sub Form_Click()
    SetPixel Me.hdc, 40, 40, &HFF
    Me.Refresh
    MsgBox ""
End Sub

Private Sub Form_Load()
    Me.AutoRedraw = True
    Me.ScaleMode = vbPixels
End Sub