Double-Clicks?

  • Thread starter Thread starter leor
  • Start date Start date
L

leor

Why doesn't the .net cf Control class have a DoubleClick Event? The regular XP/.NET framework classes for System.Windows.Forms

has an event handler:

public event System.EventHandler DoubleClick

Member of System.Windows.Forms.Control



How do you handle double-clicks on a Pocket-PC environment with .net CF?
 
largely because double-tap doesn't really exist for PPCs - the interface uses a single-tap activation (though it would be nice to have for vanilla CE!).

-Chris


Why doesn't the .net cf Control class have a DoubleClick Event? The regular XP/.NET framework classes for System.Windows.Forms

has an event handler:

public event System.EventHandler DoubleClick

Member of System.Windows.Forms.Control



How do you handle double-clicks on a Pocket-PC environment with .net CF?
 
Well the main reason you don't have a DoubleClick is because you don't have a Mouse. (Sorry to say).
The Original concept was that everything shoud be driven with the PDA Buttons.
In the mean time most (if not all) devices have a pointing device to replace the needed Mouse Functionality.

In List/Tree View you have the SelectItem/AfterSelect which react to a Mouse Click.
The ContextMenu (Popup) is similer to the Right Mouse Click, where you decide what the Menu should look like acourding the the position inside the Control (I uses this mainly in a TreeView).

There is of cource (despite the Concept that there is no Mouse) a OnMouseDown/Up/Move Event which I use to simulate Drag and Drop (which also is not supported).

In OnMouseDown you could try to find out if it has been called twice inside a certin time and react accourdinly.
This could upset the List/Tree View Select however.

Basicly I tried to avoid the use of DoubleClick in Applications that I devolop for both Systems.

Hope this helps.

Mark Johnson, Berlin Germany
(e-mail address removed)
Why doesn't the .net cf Control class have a DoubleClick Event? The regular XP/.NET framework classes for System.Windows.Forms
has an event handler:
public event System.EventHandler DoubleClick
Member of System.Windows.Forms.Control

How do you handle double-clicks on a Pocket-PC environment with .net CF?
 
instead of double clic, what about right clic ?
so here is how to detect when the user clic with it's right hand (hahaha ;-)

public const uint GN_CONTEXTMENU = 1000;

public const uint SHRG_RETURNCMD = 0x00000001;


[StructLayout(LayoutKind.Sequential)]

public class SHRGINFO

{

public uint cbSize = 0;

public IntPtr hwndClient = IntPtr.Zero;

public int x = 0; // POINT

public int y = 0; // POINT

public uint dwFlags = 0;

}

[DllImport("aygshell", SetLastError=true)]

public static extern uint SHRecognizeGesture(SHRGINFO shrg);

public bool IsContextMenu(MouseEventArgs e)

{

if(e.Button != MouseButtons.Left) // ?? just to be sure :-)

return false;

WinAPI.SHRGINFO shrginfo = new WinAPI.SHRGINFO();

shrginfo.cbSize = (uint) Marshal.SizeOf(shrginfo);

shrginfo.hwndClient = Handle;

shrginfo.x = e.X;

shrginfo.y = e.Y;

shrginfo.dwFlags = WinAPI.SHRG_RETURNCMD;


if (WinAPI.SHRecognizeGesture(shrginfo) == WinAPI.GN_CONTEXTMENU)

return true;

return false;

}

Why doesn't the .net cf Control class have a DoubleClick Event? The regular XP/.NET framework classes for System.Windows.Forms

has an event handler:

public event System.EventHandler DoubleClick

Member of System.Windows.Forms.Control



How do you handle double-clicks on a Pocket-PC environment with .net CF?
 
http://samples.gotdotnet.com/quickstart/compactframework/doc/btndclick.aspx

Shows a Sample how to support DoubleClick for Compact.
Hope this helps

Mark Johnson, Berlin Germany
(e-mail address removed)

Why doesn't the .net cf Control class have a DoubleClick Event? The regular XP/.NET framework classes for System.Windows.Forms

has an event handler:

public event System.EventHandler DoubleClick

Member of System.Windows.Forms.Control



How do you handle double-clicks on a Pocket-PC environment with .net CF?
 
Back
Top