Tuesday, May 27, 2008

Huei Programming Tips - DataGridView Keypress

*Wipes off spiderweb*

*Cleans blog*

Damn this blog is isolated. I almost drown in spiderwebs. Spiderman must've been here. HAHA

Anyways, something to remind myself on programming.

How to Simulate Cell Keypress in a Datagridview? (VB.NET 2005)

1. Make sure EVERY COLUMN is set to ReadOnly = True.

  • This is so it would not enter edit mode on each cell when you press a key.
  • When a cell is selected, you can find out the current column by using DataGridView1.CurrentCell.ColumnIndex
  • When you use KeyPress, it will run
    DataGridView1_KeyPress
2. Manually set the values into the current selected column.
  • DataGridView1.CurrentCell.Value = e.KeyChar

That way, you can use KeyPress, and get the values of the character keyed in and do the necessary checking if any.

Wednesday, May 7, 2008

Laughter

I got this yesterday, and it's nice to have a good laugh! Have a good mid week!

I like that duck!
lol
There should be one for "Idiots glued onto the TV set"

It should be Visa PLATINUM card