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. DoubleClikc Event of ComboBox

DoubleClikc Event of ComboBox

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

    Hi All!!! i am checking the double click event of ComboBox but it is not triggered on double clicking, but if we register it with TextBox, it works fine. Click event of comobo also works fine. but there is some problem with doublecliking it. Can soemone help? Thanx in advance:) sorry for my bad English.

    H 1 Reply Last reply
    0
    • I Itanium

      Hi All!!! i am checking the double click event of ComboBox but it is not triggered on double clicking, but if we register it with TextBox, it works fine. Click event of comobo also works fine. but there is some problem with doublecliking it. Can soemone help? Thanx in advance:) sorry for my bad English.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Almost all the controls in System.Windows.Forms encapsulate their Windows common controls equivalents. Not all of these controls support all the notification messages that raise events in .NET. The ComboBox, for instance, pops up and hides its scrolling popup window used for the drop down on WM_LBUTTONDOWN and is not double-click aware. If you want to make it so, you're going to have to extend the ComboBox controls in .NET, override WndProc, and handle many of these messages yourself. To handle messages like WM_LBUTTONDOWN though, you might have to use an IMessageFilter. Anyway, you'll have to capture this message before it goes to the base class's WndProc method (which you should call base.WndProc(ref m) after your code) and start a timer. If the timer elapses, call SendMessage (which you'll also have to P/Invoke) with the original data that came with the WM_LBUTTONDOWN message. If the user clicks again before the timer elapses, then you've got your double-click event and should throw-out the WM_LBUTTONDOWN message (i.e., don't send it). The easiest way to raise this event is to just call base.OnDoubleClick, which will raise the DoubleClick event.

      Microsoft MVP, Visual C# My Articles

      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