Click here to Skip to main content
14,695,085 members
Home » Discussions » Windows Forms
   

Windows Forms

 
PinnedForum Guidelines - PLEASE READ PinPopular
Chris Maunder28-Jul-09 3:38
cofounderChris Maunder28-Jul-09 3:38 
QuestionHelp me! Pin
Member 1492738231-Aug-20 9:34
MemberMember 1492738231-Aug-20 9:34 
AnswerRe: Help me! Pin
F-ES Sitecore31-Aug-20 10:18
mveF-ES Sitecore31-Aug-20 10:18 
GeneralRe: Help me! Pin
Member 1492738231-Aug-20 19:27
MemberMember 1492738231-Aug-20 19:27 
QuestionHikvision IP Camera Pin
Madmike8925-Nov-19 8:00
MemberMadmike8925-Nov-19 8:00 
QuestionCreating a Multi Form App for a Multi Monitor Windows Environment Pin
TC_Dev5-Nov-19 6:29
MemberTC_Dev5-Nov-19 6:29 
AnswerRe: Creating a Multi Form App for a Multi Monitor Windows Environment Pin
Richard Deeming10-Nov-19 23:44
mveRichard Deeming10-Nov-19 23:44 
GeneralRe: Creating a Multi Form App for a Multi Monitor Windows Environment Pin
TC_Dev11-Nov-19 0:23
MemberTC_Dev11-Nov-19 0:23 
QuestionDifferent Grid Limits Pin
michaelbarb22-Aug-19 8:35
Membermichaelbarb22-Aug-19 8:35 
AnswerRe: Different Grid Limits Pin
Mycroft Holmes22-Aug-19 13:44
professionalMycroft Holmes22-Aug-19 13:44 
GeneralRe: Different Grid Limits Pin
michaelbarb23-Aug-19 5:02
Membermichaelbarb23-Aug-19 5:02 
AnswerRe: Different Grid Limits Pin
Richard MacCutchan22-Aug-19 22:45
mveRichard MacCutchan22-Aug-19 22:45 
GeneralRe: Different Grid Limits Pin
michaelbarb23-Aug-19 4:58
Membermichaelbarb23-Aug-19 4:58 
GeneralRe: Different Grid Limits Pin
Richard MacCutchan23-Aug-19 5:08
mveRichard MacCutchan23-Aug-19 5:08 
GeneralRe: Different Grid Limits Pin
michaelbarb23-Aug-19 8:57
Membermichaelbarb23-Aug-19 8:57 
QuestionError while dragging the usercontrol from ToolBox to Form Pin
michaelbarb20-Aug-19 5:11
Membermichaelbarb20-Aug-19 5:11 
AnswerRe: Error while dragging the usercontrol from ToolBox to Form Pin
evry1falls4-May-20 15:49
Memberevry1falls4-May-20 15:49 
GeneralRe: Error while dragging the usercontrol from ToolBox to Form Pin
michaelbarb4-May-20 17:53
Membermichaelbarb4-May-20 17:53 
GeneralRe: Error while dragging the usercontrol from ToolBox to Form Pin
evry1falls4-May-20 18:24
Memberevry1falls4-May-20 18:24 
QuestionDataGridView and Key events Pin
michaelbarb19-Aug-19 11:31
Membermichaelbarb19-Aug-19 11:31 
AnswerRe: DataGridView and Key events Pin
Eddy Vluggen19-Aug-19 11:43
professionalEddy Vluggen19-Aug-19 11:43 
GeneralRe: DataGridView and Key events Pin
michaelbarb20-Aug-19 4:38
Membermichaelbarb20-Aug-19 4:38 
There is not much more to say. Create a new windows form project. Put a DataGridView in the form. Go to the events for the DataGridView. Double click any or all of the key events. Go to the code behind. Put trivial line in each event (int i = 0; i = I+1;) and set a break point. You will never trip the key events.

I tried each event without the others present. As a last test I added event "CellValueChanged" to see if I was getting some event and it worked.

namespace DataGridView_Events
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            InitializeTable();
        }

        private void InitializeTable()
        {
            dataGridView1.ColumnCount = 3;
            dataGridView1.Columns[0].Name = "Column0";
            dataGridView1.Columns[1].Name = "Column1";
            dataGridView1.Columns[2].Name = "Column2";

            dataGridView1.Rows.Add(5);
            dataGridView1.Rows[0].HeaderCell.Value = "Row1";
            dataGridView1.Rows[1].HeaderCell.Value = "Row2";
            dataGridView1.Rows[2].HeaderCell.Value = "Row3";

            for (int i = 0; i < 3; i++)
            {
                dataGridView1.Rows[i].Cells[0].Value = 0 + i;// TheTrayHandler.Axis[i].MaxSpeed;
                dataGridView1.Rows[i].Cells[1].Value = 10 + i;// TheTrayHandler.Axis[i].SpeedPercent;
                dataGridView1.Rows[i].Cells[2].Value = 20 + i;// TheTrayHandler.Axis[i].HighAccel;
            }
            dataGridView1.Refresh();
        }

        private void dataGridView1_KeyPress(object sender, KeyPressEventArgs e)
        {
            int i = 0; i = i + 1;
        }

        private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
        {
            int i = 0; i = i + 1;
        }

        private void dataGridView1_KeyUp(object sender, KeyEventArgs e)
        {
            int i = 0; i = i + 1;
        }

        private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            int i = 0; i = i + 1;
        }
    }
}

So many years of programming I have forgotten more languages than I know.

GeneralRe: DataGridView and Key events Pin
Richard MacCutchan20-Aug-19 5:17
mveRichard MacCutchan20-Aug-19 5:17 
GeneralRe: DataGridView and Key events Pin
michaelbarb20-Aug-19 7:39
Membermichaelbarb20-Aug-19 7:39 
SuggestionRe: DataGridView and Key events Pin
Richard MacCutchan19-Aug-19 22:26
mveRichard MacCutchan19-Aug-19 22:26 

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.