Click here to Skip to main content
15,901,373 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Creating a Multi Form App for a Multi Monitor Windows Environment Pin
TC_Dev10-Nov-19 23:23
TC_Dev10-Nov-19 23:23 
QuestionDifferent Grid Limits Pin
michaelbarb22-Aug-19 7:35
michaelbarb22-Aug-19 7:35 
AnswerRe: Different Grid Limits Pin
Mycroft Holmes22-Aug-19 12:44
professionalMycroft Holmes22-Aug-19 12:44 
GeneralRe: Different Grid Limits Pin
michaelbarb23-Aug-19 4:02
michaelbarb23-Aug-19 4:02 
AnswerRe: Different Grid Limits Pin
Richard MacCutchan22-Aug-19 21:45
mveRichard MacCutchan22-Aug-19 21:45 
GeneralRe: Different Grid Limits Pin
michaelbarb23-Aug-19 3:58
michaelbarb23-Aug-19 3:58 
GeneralRe: Different Grid Limits Pin
Richard MacCutchan23-Aug-19 4:08
mveRichard MacCutchan23-Aug-19 4:08 
GeneralRe: Different Grid Limits Pin
michaelbarb23-Aug-19 7:57
michaelbarb23-Aug-19 7:57 
AnswerRe: Different Grid Limits Pin
jsc4223-Jun-21 3:00
professionaljsc4223-Jun-21 3:00 
QuestionError while dragging the usercontrol from ToolBox to Form Pin
michaelbarb20-Aug-19 4:11
michaelbarb20-Aug-19 4:11 
AnswerRe: Error while dragging the usercontrol from ToolBox to Form Pin
evry1falls4-May-20 14:49
evry1falls4-May-20 14:49 
GeneralRe: Error while dragging the usercontrol from ToolBox to Form Pin
michaelbarb4-May-20 16:53
michaelbarb4-May-20 16:53 
GeneralRe: Error while dragging the usercontrol from ToolBox to Form Pin
evry1falls4-May-20 17:24
evry1falls4-May-20 17:24 
QuestionDataGridView and Key events Pin
michaelbarb19-Aug-19 10:31
michaelbarb19-Aug-19 10:31 
AnswerRe: DataGridView and Key events Pin
Eddy Vluggen19-Aug-19 10:43
professionalEddy Vluggen19-Aug-19 10:43 
GeneralRe: DataGridView and Key events Pin
michaelbarb20-Aug-19 3:38
michaelbarb20-Aug-19 3: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 4:17
mveRichard MacCutchan20-Aug-19 4:17 
GeneralRe: DataGridView and Key events Pin
michaelbarb20-Aug-19 6:39
michaelbarb20-Aug-19 6:39 
SuggestionRe: DataGridView and Key events Pin
Richard MacCutchan19-Aug-19 21:26
mveRichard MacCutchan19-Aug-19 21:26 
GeneralRe: DataGridView and Key events Pin
michaelbarb21-Aug-19 7:42
michaelbarb21-Aug-19 7:42 
GeneralRe: DataGridView and Key events Pin
Richard Deeming21-Aug-19 8:25
mveRichard Deeming21-Aug-19 8:25 
GeneralRe: DataGridView and Key events Pin
michaelbarb21-Aug-19 12:46
michaelbarb21-Aug-19 12:46 
GeneralRe: DataGridView and Key events Pin
Richard MacCutchan21-Aug-19 21:11
mveRichard MacCutchan21-Aug-19 21:11 
GeneralRe: DataGridView and Key events Pin
michaelbarb23-Aug-19 3:51
michaelbarb23-Aug-19 3:51 
GeneralRe: DataGridView and Key events Pin
Richard MacCutchan23-Aug-19 4:07
mveRichard MacCutchan23-Aug-19 4:07 

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.