Results 1 to 5 of 5

Thread: Forcing Datagrid focus from API

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Location
    Ireland
    Posts
    99
    Hi Folks
    Is there a way to force focus to a datagrid through the API? I have created a master detail form with the wizard. When I create a new master record I cannot tab to the detail datagrid, unless a child entry exists. I am forced to click on the grid to get focus.
    Cheers

  2. #2
    Tygur
    Guest
    I don't think you need the API

    Did you try:
    DataGridName.SetFocus

    ..to set focus to the datagrid?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Location
    Ireland
    Posts
    99
    Yes, and it dosent work

  4. #4
    Tygur
    Guest
    There is a SetFocus API.

    Put this in the General Declarations area above all the code:
    Private Declare Function SetFocusAPI Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long

    Here's how to use it:
    SetFocusAPI DataGridName.hwnd

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Location
    Ireland
    Posts
    99

    Thumbs up

    Thanks Tygur
    This thing was twisting me melons for ages
    Your help is invaluable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width