Click here to Skip to main content
15,892,161 members
Home / Discussions / C#
   

C#

 
GeneralRe: reentrant call to the SetCurrentCellAddressCore function. Pin
Nadia Monalisa29-Oct-06 6:41
Nadia Monalisa29-Oct-06 6:41 
Questionhow to get holding key down to repeat an action Pin
bradsnobar27-Oct-06 14:07
bradsnobar27-Oct-06 14:07 
AnswerRe: how to get holding key down to repeat an action Pin
sam#27-Oct-06 18:21
sam#27-Oct-06 18:21 
GeneralRe: how to get holding key down to repeat an action Pin
bradsnobar27-Oct-06 21:15
bradsnobar27-Oct-06 21:15 
AnswerRe: how to get holding key down to repeat an action Pin
Nader Elshehabi27-Oct-06 20:56
Nader Elshehabi27-Oct-06 20:56 
GeneralRe: how to get holding key down to repeat an action Pin
bradsnobar27-Oct-06 21:15
bradsnobar27-Oct-06 21:15 
GeneralRe: how to get holding key down to repeat an action Pin
Nader Elshehabi27-Oct-06 21:31
Nader Elshehabi27-Oct-06 21:31 
AnswerFound the answer Pin
bradsnobar27-Oct-06 21:20
bradsnobar27-Oct-06 21:20 
I found the snippet to handle an arrow key being repeated in a winform control.

The ProcessCmdKey method must be overriden to trap that key and the repeat message.

Normally the keypress event is the one that allows repeat keypresses by holding the key down. (This rate of repeat is controlled by the bios and the OS)

The keypress event does not trap the arrow keys.

    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    {
      const int WM_KEYDOWN = 256;
      const int WM_CHAR = 258;
      const int WM_KEYUP = 257;
      const int WM_SYSKEYDOWN = 260;
      const int WM_SYSKEYUP = 261;

      if (FromHandle(msg.HWnd) == this)
      {
        switch (msg.Msg)
        {
          case WM_KEYDOWN:
            switch (keyData)
            {
              case Keys.Down:
                int tag = (int)msg.LParam;
                bool repeat = (tag & (1 << 30)) != 0;

                if (repeat == true)
                  System.Diagnostics.Debug.WriteLine("********************");

                if (this.SelectedIndex + 1 >= this.menuItems.Count)
                  this.SelectedIndex = 0;
                else
                  this.SelectedIndex++;
GeneralRe: Found the answer Pin
DiegoValdevino28-Oct-06 3:18
DiegoValdevino28-Oct-06 3:18 
Questionstore procedure vs hard coding sql statements Pin
keroed_edmond27-Oct-06 12:07
keroed_edmond27-Oct-06 12:07 
AnswerRe: store procedure vs hard coding sql statements Pin
bradsnobar27-Oct-06 14:20
bradsnobar27-Oct-06 14:20 
AnswerRe: store procedure vs hard coding sql statements Pin
Rob Graham27-Oct-06 14:29
Rob Graham27-Oct-06 14:29 
AnswerRe: store procedure vs hard coding sql statements Pin
Tad McClellan27-Oct-06 16:31
professionalTad McClellan27-Oct-06 16:31 
AnswerRe: store procedure vs hard coding sql statements Pin
Pete O'Hanlon30-Oct-06 2:02
mvePete O'Hanlon30-Oct-06 2:02 
QuestionIs it possible to write app. for symbian by VS2005 and C# or VB.NET? Pin
Code4Null27-Oct-06 10:49
Code4Null27-Oct-06 10:49 
AnswerRe: Is it possible to write app. for symbian by VS2005 and C# or VB.NET? Pin
led mike27-Oct-06 11:01
led mike27-Oct-06 11:01 
GeneralRe: Is it possible to write app. for symbian by VS2005 and C# or VB.NET? Pin
Code4Null27-Oct-06 11:24
Code4Null27-Oct-06 11:24 
GeneralRe: Is it possible to write app. for symbian by VS2005 and C# or VB.NET? Pin
Rob Graham27-Oct-06 11:30
Rob Graham27-Oct-06 11:30 
GeneralRe: Is it possible to write app. for symbian by VS2005 and C# or VB.NET? Pin
led mike27-Oct-06 11:35
led mike27-Oct-06 11:35 
AnswerRe: Is it possible to write app. for symbian by VS2005 and C# or VB.NET? Pin
Nader Elshehabi27-Oct-06 20:27
Nader Elshehabi27-Oct-06 20:27 
QuestionSql Command with C# Pin
Areff27-Oct-06 9:56
Areff27-Oct-06 9:56 
AnswerRe: Sql Command with C# Pin
led mike27-Oct-06 10:08
led mike27-Oct-06 10:08 
AnswerRe: Sql Command with C# Pin
BoneSoft27-Oct-06 10:10
BoneSoft27-Oct-06 10:10 
AnswerRe: Sql Command with C# Pin
Rob Graham27-Oct-06 10:36
Rob Graham27-Oct-06 10:36 
GeneralRe: Sql Command with C# Pin
BoneSoft27-Oct-06 10:44
BoneSoft27-Oct-06 10:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.