Friday, November 16, 2007

Preventing applications from stealing focus

I just found a great Windows tip. I was dreaming about something like for a long time!
Here is where I found it.

Preventing Applications from Stealing the Focus

To prevent applications from stealing the focus from the window you are working

  1. Start Regedit

  2. Go to HKEY_CURRENT_USER \ Control Panel \ Desktop

  3. Edit the key ForegroundLockTimeout

  4. Give it a value of 00030d40

Monday, November 12, 2007

Disabling Edit/Delete Button in a GridRow

This simple short piece of code is so easy, yet, when I don't use it everyday I forget it, and then I have to look it up again and again. So I will just put it here and will never have to search for it.

When there is a need to hide the delete/edit button in a grid, on a row level, in the ItemDataBound handler, place the following line:

CType(e.Item.Cells(index).Controls(0), System.Web.UI.WebControls.LinkButton).Visible = False