Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. can not focus on the form at run time

can not focus on the form at run time

Scheduled Pinned Locked Moved Mobile
databasedata-structuresquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    iman_kh
    wrote on last edited by
    #1

    hi i am developing a vs2008 smart device application. in this project there is a form array which contains form objects. index of this array (forms) will be selected by the operator at run time. when the operator selects one form , it is focused by the form.Focus() Method. but this method returns false and form can not focus ! why?

    D L 2 Replies Last reply
    0
    • I iman_kh

      hi i am developing a vs2008 smart device application. in this project there is a form array which contains form objects. index of this array (forms) will be selected by the operator at run time. when the operator selects one form , it is focused by the form.Focus() Method. but this method returns false and form can not focus ! why?

      D Offline
      D Offline
      Drazen Pupovac
      wrote on last edited by
      #2

      I think the problem is that the form isn't visible. Try to use this to set focus on form:

      [DllImport("user32.dll")]
      private extern static IntPtr SetFocus(IntPtr hwnd);

      1 Reply Last reply
      0
      • I iman_kh

        hi i am developing a vs2008 smart device application. in this project there is a form array which contains form objects. index of this array (forms) will be selected by the operator at run time. when the operator selects one form , it is focused by the form.Focus() Method. but this method returns false and form can not focus ! why?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        See here[^] for some notes about correct use of the Focus() method.

        Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups