这什么SetPixel 完全没效果
这什么SetPixel 完全没效果
- VB code
Private Declare Function SetPixel Lib "gdi32 " (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As LongPrivate 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中
- VB code
Private Declare Function SetPixel Lib "gdi32 " (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As LongPrivate Sub Form_Click() SetPixel Me.hdc, 40, 40, &HFF Me.Refresh MsgBox ""End SubPrivate Sub Form_Load() Me.AutoRedraw = True Me.ScaleMode = vbPixelsEnd Sub