|
-
May 15th, 2000, 02:37 AM
#1
Thread Starter
Addicted Member
Hello,
I'm developing an OCX and I'm in trouble of how
to draw the focus on the first control when the form
loads (the control with the TabIndex=0).
The focus jumps from one control to another correctly.
Only the focus of the first control of the form isn't being showed correctly.
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
Is there any special tip to show the focus correctly?
Thanks for any help.
Michel Jr.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|