Click here to Skip to main content
15,879,326 members
Home / Discussions / Windows Forms
   

Windows Forms

 
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 
QuestionRipping music from CD Windows Vista vs Windows 10? Pin
Tovino James3-Jul-19 19:49
Tovino James3-Jul-19 19:49 
AnswerRe: Ripping music from CD Windows Vista vs Windows 10? Pin
OriginalGriff3-Jul-19 19:56
mveOriginalGriff3-Jul-19 19:56 
AnswerRe: Ripping music from CD Windows Vista vs Windows 10? Pin
Eddy Vluggen19-Aug-19 12:53
professionalEddy Vluggen19-Aug-19 12:53 
QuestionPDF Drag Drop windows form application Pin
Member 1450785221-Jun-19 1:52
Member 1450785221-Jun-19 1:52 
QuestionWinform dox matrix printer direct printing Pin
Member 1368241416-Jun-19 3:56
Member 1368241416-Jun-19 3:56 
AnswerRe: Winform dox matrix printer direct printing Pin
Richard MacCutchan16-Jun-19 5:23
mveRichard MacCutchan16-Jun-19 5:23 
GeneralRe: Winform dox matrix printer direct printing Pin
Member 1368241416-Jun-19 20:55
Member 1368241416-Jun-19 20:55 
GeneralRe: Winform dox matrix printer direct printing Pin
Dave Kreskowiak17-Jun-19 4:39
mveDave Kreskowiak17-Jun-19 4:39 
AnswerRe: Winform dox matrix printer direct printing Pin
Gerry Schmitz16-Jun-19 7:08
mveGerry Schmitz16-Jun-19 7:08 

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.