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. Focus problems...

Focus problems...

Scheduled Pinned Locked Moved C#
comquestion
2 Posts 2 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.
  • J Offline
    J Offline
    Joshua Guy
    wrote on last edited by
    #1

    I have a Windows Form component that responds to the mouse wheel. On my test form it is the only control and works great, but in my application I have a browser control and serveral instances of that control. In this situation the control never responds to the scroll messages. I have tried setting the focus to it when the mouse enters and all sorts of other things. Any suggestions? BTW, I'm betting James knows. ;P Joshua Guy


    Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

    J 1 Reply Last reply
    0
    • J Joshua Guy

      I have a Windows Form component that responds to the mouse wheel. On my test form it is the only control and works great, but in my application I have a browser control and serveral instances of that control. In this situation the control never responds to the scroll messages. I have tried setting the focus to it when the mouse enters and all sorts of other things. Any suggestions? BTW, I'm betting James knows. ;P Joshua Guy


      Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      Joshua Guy wrote: BTW, I'm betting James knows. Off the top of my head... in Form_Load Application.AddMessageFilter(myComponent as IMessageFilter); in your component

      public class MyComponent : ......, IMessageFilter
      {
      ......

      bool IMessageFilter.PreFilterMessage(ref Message m)
      {
      if( m.Msg == 0x020A )
      {
      m.HWnd = this.Handle; // Just in case it checks the HWnd :)
      WndProc(ref m); // Let it dispatch the mouse wheel events to your control
      return true;
      }

      return false;
      

      }
      }

      Hopfully that'll work, I haven't tested it :) James Simplicity Rules!

      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