Wednesday, September 29, 2010

Common Keyboard Shortcuts !!!

Shortcut Keys Function
Display or hide the Start menu.
+BREAK Display the System Properties dialog box.
+D Minimizes all Windows and shows the Desktop
+E Open Windows Explorer
+F Search for a file or folder.
+F+CTRL Search for computers.
+F1 Display Windows 2000 Help.
+L Locks the desktop
+M Minimize or restore all windows.
+R Open the Run dialog box.
+TAB Switch between open items.
+U Open Utility Manager
ALT+- (ALT+hyphen) Displays the Multiple Document Interface (MDI) child window's System menu.
ALT+ENTER View properties for the selected item.
ALT+ESC Cycle through items in the order they were opened.
ALT+F4 Close the active item, or quit the active program.
ALT+SPACEBAR Display the System menu for the active window.
ALT+TAB Switch between open items.
ALT+Underlined letter in a menu name Display the corresponding menu.
BACKSPACE View the folder one level up in My Computer or Windows Explorer.
CTRL+A Select all.
CTRL+B Bold
CTRL+C Copy.
CTRL+I Italics
CTRL+O Open an item.
CTRL+U Underline
CTRL+V Paste.
CTRL+X Cut.
CTRL+Z Undo.
CTRL+F4 Close the active document in programs that allow you to have multiple documents open simultaneously.
CTRL while dragging an item Copy selected item.
CTRL+SHIFT while dragging an item Create shortcut to selected item.
CTRL+RIGHT ARROW Move the insertion point to the beginning of the next word.
CTRL+LEFT ARROW Move the insertion point to the beginning of the previous word.
CTRL+DOWN ARROW Move the insertion point to the beginning of the next paragraph.
CTRL+UP ARROW Move the insertion point to the beginning of the previous paragraph.
CTRL+SHIFT with any of the arrow keys Highlight a block of text.
DELETE Delete.
SHIFT+DELETE Delete selected item permanently without placing the item in the Recycle Bin.
ESC Cancel the current task.
F1 Displays Help
F2 Rename selected item.
F3 Search for a file or folder.
F4 Display the Address bar list in My Computer or Windows Explorer.
F5 Refresh the active window.
F6 Cycle through screen elements in a window or on the desktop.
F10 Activate the menu bar in the active program.
SHIFT+F10 Display the shortcut menu for the selected item.
CTRL+ESC Display the Start menu.
SHIFT+CTRL+ESC Launches Task Manager
Underlined letter in a command name on an open menu Carry out the corresponding command.
RIGHT ARROW Open the next menu to the right, or open a submenu.
LEFT ARROW Open the next menu to the left, or close a submenu.
SHIFT with any of the arrow keys Select more than one item in a window or on the desktop, or select text within a document.
SHIFT when you insert a CD into the CD-ROM drive Prevent the CD from automatically playing.

CODE FOR SELECTING WHOLE ROW IN DATAGRIDVIEW !!!!!

Hello Again
Suppose we want to select whole row in the DataGridView with a single enter click.
Then for this purpose we have the following code ------->>>>>


//Write this code in keydown event of DGV!
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
        {
if (e.KeyCode == Keys.Enter)
            {

               this.dataGridView1.CurrentRow.Selected = true;
                e.Handled = true;
            }
        }



Hope it will work.
Any kind of comment are welcome

How To Use Enter Key As Tab In DataGridView

Hello everyone,
We have a condition in which we have a DataGridView and our requirement is that we want to use enter key to move to next cell of the same row and after finishing the row, the focus should  go to next row and again perform  the same operation.
so for this work we have to use the following code in dataGridView1_KeyDown() event which  we get from the properties of the dataGridView1.


The code is like


 private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
        {
            //check for enter key
            if (e.KeyCode == Keys.Enter)
            {
                DataGridView vw = (DataGridView)sender;
                //check for last row
                if (vw.CurrentCell.RowIndex == vw.Rows.Count - 1)
                {
                    //if it's not the last cell, move to the next one
                    if (vw.CurrentCell.ColumnIndex != vw.ColumnCount - 1)
                    {
                        vw.CurrentCell = vw.Rows[vw.CurrentCell.RowIndex].Cells[vw.CurrentCell.ColumnIndex + 1];
                    }
                    else // if last cell then either enter new raw or move to first cell.
                    {
                        //move to first column in new row
                        vw.Rows.Add(1);
                        vw.Refresh();
                        SendKeys.Send("{HOME}");
                    }
                }
                else
                {
                    //if it's the last cell, move to the next row, first cell
                    if (vw.CurrentCell.ColumnIndex == vw.ColumnCount - 1)
                    {
                        vw.CurrentCell = vw.Rows[vw.CurrentCell.RowIndex + 1].Cells[0];
                    }
                    else
                    {
                        //move to the next cell on the current row
                        vw.CurrentCell = vw.Rows[vw.CurrentCell.RowIndex].Cells[vw.CurrentCell.ColumnIndex + 1];
                    }
                }
                //mark the keycode as handled
                e.Handled = true;
            }
        } 






If you have any query regarding this you can ask me anytime
Also all kind of comments are always welcome.


Thanks
@vg