Hello,

I'm developing an OCX (a simple Command Button) and
I'm in trouble to draw the focus on it (EnterFocus/GotFocus properties).


This is my code:

Private Sub UserControl_EnterFocus()
UserControl.ScaleMode = 3
lpRect.Top = 3
lpRect.Left = 3
lpRect.Right = (UserControl.Width \ Screen.TwipsPerPixelX) - 3
lpRect.Bottom = (UserControl.Height \ Screen.TwipsPerPixelY) - 3

DrawFocusRect UserControl.hdc, lpRect
UserControl.ScaleMode = 1
End Sub


Private Sub UserControl_ExitFocus()
UserControl.ScaleMode = 3
lpRect.Top = 3
lpRect.Left = 3
lpRect.Right = (UserControl.Width \ Screen.TwipsPerPixelX) - 3
lpRect.Bottom = (UserControl.Height \ Screen.TwipsPerPixelY) - 3

DrawFocusRect UserControl.hdc, lpRect
UserControl.ScaleMode = 1
End Sub


Does anybody can show me the correct way to draw
the Focus?

Thanks a lot...

Michel Jr.