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. General Programming
  3. C#
  4. MDI Forms and focus frustration, please help

MDI Forms and focus frustration, please help

Scheduled Pinned Locked Moved C#
helpquestion
2 Posts 1 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.
  • K Offline
    K Offline
    kensai
    wrote on last edited by
    #1

    I have a problem with mdi forms in my application. There are two mdi forms. They have scroll bars. There is a control on the left mdi form near to the top. Now the problem is: I scroll the left mdi form to the bottom. I click to the other mdi form. I click back to the left mdi form and when the left one is activated/focused it automatically scrolls to the top where the control is and sets focus to it. There're absolutely nothing in the code anywhere to do this. There're no .Focus() calls, no OnFocus event, .ActiveControl= etc. Nothing. I couldn't find a way to prevent this and it's driving me insane. I even tried to handle *FOCUS Windows messages it's receiving but failed. Can you please help me find a way to prevent this? I appreciate any help.

    K 1 Reply Last reply
    0
    • K kensai

      I have a problem with mdi forms in my application. There are two mdi forms. They have scroll bars. There is a control on the left mdi form near to the top. Now the problem is: I scroll the left mdi form to the bottom. I click to the other mdi form. I click back to the left mdi form and when the left one is activated/focused it automatically scrolls to the top where the control is and sets focus to it. There're absolutely nothing in the code anywhere to do this. There're no .Focus() calls, no OnFocus event, .ActiveControl= etc. Nothing. I couldn't find a way to prevent this and it's driving me insane. I even tried to handle *FOCUS Windows messages it's receiving but failed. Can you please help me find a way to prevent this? I appreciate any help.

      K Offline
      K Offline
      kensai
      wrote on last edited by
      #2

      I've solved the problem. Turns out mdi form focusing to the control with lowest TabIndex value behavior is by design. Setting TabStop property of every control to false prevents this from happening.

      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