My favorite part about arriving at a conference is receiving a new backpack at the registration desk. I would have to give this backpack a 4 out of 5. It has a very cool separate pocket for a tablet, which for the most part fits my Surface Pro, along with the standard laptop pocket.

Which captured the Event Behavior: KeyPress which was used to trigger an action after the Enter Key was pressed.

During a project to allow our admins to change the manager field in our AD LDS Identity Store I was coding a Textbox to be triggered with the tab key, but low and behold they TAB key is not captured by default by the KeyDown, KeyPress or KeyUp Events.

Certain keys, such as the TAB, RETURN, ESC, and arrow keys are handled by controls automatically. To have these keys raise the KeyDown event, you must override the IsInputKey method in each control on your form. The code for the override of the IsInputKey would need to determine if one of the special keys is pressed and return a value of true. Instead of overriding the IsInputKey method, you can handle the PreviewKeyDown event and set the IsInputKey property to true.

Note the IsInputKey method must be set per control, so there is no need to turn it back off for other controls on the same form.

So in this example I start with a basic form with two labels, two textboxes, and a status bar to show when the TAB or ENTER keys are captured.

For the Event Behaivior: PreviewKeyDown for $textbox1 I setup the following code:

I had a hard time finding examples on the web on how or if you could code multiple If’s into a single If statement, so I thought I would just quick post up an example once I figured out how to do it. Perhaps I wasn’t looking in the right places but all the examples I saw were just a single (-and) or (-or) in the code.

So based on being able to code an If statement in either of the following fashions:

The next event behavior I wanted to cover was hitting a Enter Key within a textbox control and have it trigger another event.

In this examble I have three basic controls a textbox,a button and a listbox. I am using the textbox as a Search Textbox, after entering text to search the end user can either press Enter or the ‘find’ button.

First add the Event Handler for the Textbox to response only to the Enterkey.

Next add the Event Handler to search Active Directory using the text from the TextBox($txbFind) after the button($btnFind) is single clicked.

Next the code for handler_button1_Click. First the Event handler clears the listbox ($lstResults) then it searches Active Directory with the text from the Textbox ($txbFind). Then if the results if not null, the handler will list the results in the listbox($lstResults)

I decided that I would post how to code a few Event Behaviors that could be coded with PowerShell using PrimalForms. You could just use your basic PowerShell Editor but PrimalForms is just my tool of choice.

The rumors that ADFS 2.0 would be released today were true. Microsoft released Active Directory Federation Services (ADFS) 2.0 RTW today. I know RTM is Released To Manufacturing so does RTW mean Released to World?

There have been rumors floating around that ADFS 2.0 would be released today. As I was stumbling around Technet today I ran across the articles that were updated 5-5-2010. Perhaps the rumors are true, we will soon see. Keep you eyes peeled for a update from Team Geneva’s blog.