Print Search Rate
    
   04-19-2006, 2:37 PM
HOWTO: Set focus to a control on a dockable form.
Attachment: abHostedForm.zip

When using dockable forms that contain various controls, users often require the ability to set focus to a control within that form. This functionality is possible. However, you must ensure your form is completely loaded before you can set focus to the control using the SetFocus method.

Option Explicit ... Private Sub Form_Load() Dim f As New frmHosted 'Host an instance of a form on ourband Me.ab.Bands("theBand").Tools("theForm").Custom = f 'Show the host form Me.Show 'Allow our hosted form to be loaded DoEvents 'Set focus to a textbox on our hosted form f.txtTest.SetFocus End Sub

The attached samples (one for version 2 and one for version 3) demonstrate the use of the code above to set focus to a text box control on a dockable form.



Applies To:
ActiveBar 2.0
ActiveBar 3.0
GrapeCity » Knowledge Base » KnowledgeBase f... » HOWTO: Set focus to a control on a dockable form.
Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.