Saturday, August 25, 2007

Ms Word tips

Where Was I? I get up and walk around frequently when I’m writing—gets the blood flowing. Sometimes I close a document I am editing, and when I come back to it and open it up, I just hit Shift + F5 to return to the exact place in the document where I was editing.

Serial Saves. If you’re like me, you often have many documents open at once. For safety’s sake, I like to frequently save all of them at once. To do this, hold down the Shift key when you go to the File menu. This changes Save to Save All.

Paragraph Hopping. You can circumvent the multi-step process of cutting, pasting and deleting to move paragraphs with an easy paragraph hopping feature. Often when I’m writing, I decide that a given paragraph would work better above or below another one. Do this: Go into a document with several paragraphs and put your cursor at the beginning of one of the middle paragraphs. Hold down the Shift and Alt keys in unison, then use the up and down arrow keys to “hop” the paragraph to new positions in the document.

One Fell Swoop Word Deletion. You can delete entire words with your keyboard. Just put your cursor at the beginning of the word and press Ctrl and Del together. This is very useful when editing.

Customize Line Spacing and Alignment. The Ctrl key is your best buddy when you want to experiment with line spacing and alignment variations. Ctrl + 1 provides single spacing, Ctrl + 2 provides double spacing and Ctrl + 5 provides 1-1/2 line spacing. Ctrl + R right aligns a paragraph, Ctrl + L left aligns one, and Ctrl + E centers one.

Quick Selecting. You can select all text between the current location of your cursor and the end of the current paragraph by hitting Ctrl + Shift and the down arrow.

 

Ctrl + [ or ], de- or increases the font of the selected text with 1 point.

 

Ctrl + “+” for subscript and ctrl + shift + “+” for superscript

 

Shift + F3 changes the case of selected text — UPPER — lower — Sentence case.

 

After ctrl-Z you can step back your changes by using Ctrl Y.

 

Press Control + Shift + C to copy the formatting and styles.

 

Select the location of the text where the formatting and style needs to be applied, and then
Press Control + Shift + V to paste the style and formatting (including Colors, Fonts, Font sizes, Paragraph styles, Headings and everything else).

Microsoft Keyboard Shortcuts

Source

Friday, August 24, 2007

DataGridView - Copy multiple cells to clipboard

How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control

DataGridView Column Header Style

In order to use styles in your DataGridView control for your .NET 2.0 Windows application, you must specify dgvMyDataGridView.EnableHeadersVisualStyles = false.
Example of the code:

//Instantiate new DataGridViewCellStyle
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 =
    new System.Windows.Forms.DataGridViewCellStyle();

//Define Header Style
dataGridViewCellStyle2.Alignment =
    System.Windows.Forms.DataGridViewContentAlignment.BottomCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.Navy;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif",
    8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle2.SelectionBackColor =
    System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Navy;
dataGridViewCellStyle2.WrapMode =
    System.Windows.Forms.DataGridViewTriState.True;

//Apply Header Style
this.dgvTransactions.ColumnHeadersDefaultCellStyle =
    dataGridViewCellStyle2;

//Disable Headers Visual Styles - apparently there is an "automatic"
// visual style that needs to be disabled
this.dgvTransactions.EnableHeadersVisualStyles = false;

Cell Styles in the Windows Forms DataGridView Control

Source

DataGridView - Conditional Color Change

If DataGridView.Rows(i).Cells("locuscount").Value = "0" Then
          DataGridView.Rows(i).Cells("Status").Style.BackColor() = Color.AliceBlue
End If

DataGridView - Click Location & Selected Col/Row

 

For selected column and row:

private void myDataGridView_MouseDown(object sender, MouseEventArgs e)
{
    int ColumnIndex =myDataGridView.SelectedColumns[0].Index;  // Selected Column Index
    int RowIndex = myDataGridView.SelectedRows[0].Index;  // Selected Row Index
}
 
 
For click location use:
 
DataGridView.HitTestInfo myHit = dataGridView1.HitTest(e.X, e.Y);
if (myHit.Type == DataGridViewHitTestType.Cell)
{
    // select row == myHit.RowIndex;
}

Friday, August 3, 2007

Remove Old Drivers After Upgrading to New Hardware

If you are experiencing weird issues after upgrading your hardware, or you've just upgraded to the latest hardware device and aren't seeing the performance you'd like, you might want to remove the old drivers which are still installed for the old hardware, even though you can't normally see them in device manager.

What you have to do is set a less-known flag to allow you to see non-present devices, and then launch device manager. You'll then see the old devices in the list, and can uninstall the drivers for them.

In Windows Vista, the first thing you'll need to do is open a command prompt in administrator mode. Type cmd into the start menu search box, and then use Ctrl+Shift+Enter to open in administrator mode. (You can also right-click on the command prompt and choose Run as Administrator)

Now paste in the following line:

SET DEVMGR_SHOW_NONPRESENT_DEVICES=1

Then type in devmgmt.msc to start up Device Manager from the administrator command prompt.

Once you are in Device Manager, go to the View menu and choose Show Hidden Devices, which will show all the device drivers including things that aren't currently installed in your computer.

You can right-click on the driver and then choose Uninstall from the menu to remove the drivers for that old hardware.

I've found that this can resolve a lot of weird issues, and even increase performance on some machines where you've upgraded a ton of times. This isn't necessarily going to increase performance, but it's nice to have a tidy computer nonetheless.

This tip also works the same in Windows XP.

Source