The Team Explorer in Visual Studio provides a quick (and not exactly obvious) method for attaching a screenshot or other content to a Work Item.
Screenshots
To quickly add a screenshot do the following:
1. Press PrtScrn or Alt+PrntScrn (Captures only the currently active window)
2. Open a Work Item (Bug, Task, etc) in team explorer
3. Click “File Attachments”
4. Press Ctrl+V (Paste)
A file called “Screenshot.png” is automatically attached to the work item.
Copied Text
To quickly add any copied text as an attachment to a work item do the following:
1. Select the text to copy (or press Ctrl+A to select all text in the active input area like a page or document)
2. Open a Work Item (Bug, Task, etc) in team explorer
3. Click “File Attachments”
4. Press Ctrl+V (Paste)
A file called “PastedText.txt” is automatically attached to the work item.
Copied Files
You can also quickly add a file from your desktop as an attachment using the same steps as above:
1. Select the files to copy
2. Open a Work Item (Bug, Task, etc) in team explorer
3. Click “File Attachments”
4. Press Ctrl+V (Paste)
Each of the files selected is now attached to the work item.
Bonus Tip – Copy and Paste Text from an Alert
If you get an alert in a page like so:

Simply press Ctrl+C (Copy) to copy the contents of the dialog into the clipboard. To paste the text you can just use Ctrl+V:
---------------------------
Windows Internet Explorer
---------------------------
You can copy this
---------------------------
OK
---------------------------
From the official website:
New York Times #1 best-selling author Robert Jordan passed away on Sunday September 16th at 2:45 PM EST. His passing was announced by his cousin Wilson on his official blog, hosted here.
[http://www.dragonmount.com/]
I've been reading Robert Jordan's novels for a long time and have all of the available "Wheel of Time" books featured prominently on my bookshelves at home. His fantasy writings were complex and emotional, weaving together the lives of many characters through dark and trying times. He died before completing the 12th and final volume of the "Wheel of Time" series although currently it is believed that enough of the final volume has been penned to be able to complete the series, although the exact time frame for the final volume is still unknown.
The story is on CNN and additional information is available at the following fan sites:
wotmania.com TarValon.net Theoryland.com
I've been working on some bugs in the Calendar extender from the ASP.NET AJAX Control Toolkit and have been resolving some of the focus/blur events. I've been trying to make the calendar work consistently across all of the browsers and found some frustrating differences in event firing order between the browsers.
Here are a list of some of the DOM events supported by the various browsers I tested:
Table 1 - DOM Events by Browser
| Event | DOM Level | IE | FF | OP | SF |
| DOMActivate | Level 2 | | | | * |
| activate | 2 | * | | | |
| DOMFocusIn | Level 2 | | | 1 | 1 |
| focusin | 2 | * | | | |
| focus | Level 0 | * | 1 | 1 | 1 |
| DOMDeactivate | Level 2 | | | | |
| deactivate | 2 | * | | | |
| DOMFocusOut | Level 2 | | | 1 | 1 |
| focusout | 2 | * | | | |
| blur | Level 0 | * | 1 | 1 | 1 |
| mousedown | Level 0 | * | * | * | * |
| mouseup | Level 0 | * | * | * | * |
| click | Level 0 | * | * | * | * |
IE: Internet Explorer 7.0
FF: Firefox 2.0.0.6
OP: Opera 9.23
SF: Safari 3.03 Beta (Windows)
*: Implemented on any element
1: Implemented only on specific elements
2: IE-only implementation
Internet Explorer uses activate/focusin/focusout instead of DOMActivate/DOMFocusIn/DOMFocusOut for events. Interestingly only IE and Safari support DOMActivate/activate on any element. Another thing I saw was that IE is the only browser which fires focus/blur events for any element. Other browsers can support the focus/blur events on any element that has a tab index however.
The next version of Calendar needs to support the following activation scenarios depending on whether it is also associated with a button:
- No Button
- Show Popup when textbox receives focus
- Show Popup when textbox is clicked
- Hide Popup when textbox loses focus
- Hide Popup when textbox receives ESC keypress
- Hide Popup when a date is selected
- Button
- Show Popup when the button is clicked
- Hide Popup when the button loses focus
- Hide Popup when the button receives ESC keypress
- Hide Popup when a date is selected
The issue is that when the textbox or button loses focus the popup should hide unless the focus is being directed at the popup itself. The problem is that only IE recognizes a focus event on the popup's DIV tag when the popup is not part of the tab order (and we don't want the popup in the tab order). I was curious the order of DOM events fired in each browser so I wrote a small test page and stepped through for each. The results are as follows:
Table 2 - DOM Event Order by browser
| IE | FF | OP | SF |
- // click on INPUT
- INPUT: mousedown
- INPUT: activate
- INPUT: focusin
- INPUT: focus
- INPUT: mouseup
- INPUT: click
- // click on DIV
- DIV: mousedown
- INPUT: deactivate
- INPUT: focusout
- DIV: activate
- DIV: focusin
- INPUT: blur
- DIV: focus
- DIV: mouseup
- DIV: click
- // click away
- DIV: deactivate
- DIV: focusout
- DIV: blur
| - // click on INPUT
- INPUT: mousedown
- INPUT: focus
- INPUT: mouseup
- INPUT: click
- // click on DIV
- DIV: mousedown
- INPUT: blur
- DIV: mouseup
- DIV: click
- // click away
| - // click on INPUT
- INPUT: focus
- INPUT: DOMFocusIn
- INPUT: mousedown
- INPUT: mouseup
- INPUT: click
- // click on DIV
- INPUT: blur
- INPUT: DOMFocusOut
- DIV: mousedown
- DIV: mouseup
- DIV: click
- // click away
| - // click on INPUT
- INPUT: mousedown
- INPUT: focus
- INPUT: DOMFocusIn
- INPUT: mouseup
- INPUT: click
- INPUT: DOMActivate
- // click on DIV
- DIV: mousedown
- INPUT: blur
- INPUT: DOMFocusOut
- DIV: mouseup
- DIV: click
- DIV: DOMActivate
- // click away
|
Immediately a few things become obvious. First, I obviously cannot rely on focus/blur on the other browsers. IE would allow me to capture focusin on the DIV before the blur fires on the INPUT but that's just IE. Second, on all browsers except Opera the mousedown event of the DIV fires before the blur event of the INPUT. There's no clean sequential way to handle the focus transition in all browsers.
In the current version of Calendar we're making use of a "threading" class I created for the toolkit called DeferredOperation. DeferredOperation wraps a delegate and executes it asynchronously using setTimout. It has some built-in synchronization semantics and was used to handle the focus changes while the popup DIV was part of the tab order (which again, we don't really want). This introduces a subtle delay between activation requests and is problematic on Safari (we had to wait a full second before processing the deferred operation to let safari to catch up).
What I've opted for now is to do the best I can in three out of four of the browsers. I track mousedown/mouseup using a flag and in Internet Explorer, Firefox, and Safari and monitor the flag in the blur event of the textbox. To handle the Opera inconsistency I again use a DeferredOperation to asynchronously handle the blur event which fixes the issue in that browser.
The final issue I discovered was that in all browsers, clicking on the popup causes the textbox (or button) to lose focus which again causes problems with the tab order. On the new Calendar I reset the focus to the textbox (or button) on mouseup on the popup.
Hopefully these changes should make the next toolkit release so keep an eye out for the next update.
I usually use the handy VS macro "Hide Selection" (Ctrl+M,H) to collapse function and prototype blocks when doing Ajax development on a large script file. While it may not be the most efficient implementation at current, it gets the job done.
All content is provided "AS IS" and confers no warranties or rights.
This article was originally posted on 2/2/2007. The original host of the article is no longer available. Due to the high demand for the content I am reproducing it in its entirety. Click below for the full article.
Read 'Skinning model for Calendar and Tabs in Ajax Control Toolkit'...
Finally back on the blogging scene. A lot has happened in the last 6 months and now that things are settling down I finally have a chance to start putting some content on my blog.
First, a little about me. My name is Ron Buckton and I am a Senior Consultant for Microsoft Services in the Federal District, Public Sector. What this means is that I work primarily with Public Sector government contracts for MCS. I started with Microsoft back in May after a number of interviews and trips back and forth to Redmond, WA and Washington, DC. Prior to joining Microsoft I was working for a Microsoft partner in Cleveland, OH where I previously did most of my blogging.
Back in 2006 I joined the Ajax Control Toolkit as a contributor and among my contributions number the Calendar, Tabs, DropDown, and a number of other smaller extenders and numerous architectural features within the toolkit such as ScriptControl and ScriptUserControl. I had a number of useful blog posts about the toolkit on my former blog but unfortunately the blog was taken down shortly after I left and I have yet to have the time to pull those posts out of my archives to republish here.
A number of people on the ASP.Net forums have been asking for me to republish the content in some form, specifically the posts revolving around skinning the Calendar and Tabs controls using CSS. I plan on having those posts cleaned up and published as articles on this blog before too much longer.
Aside from the Toolkit and my original ASP.Net development focus I am now very heavily involved in mobile device development. As a result you'll see a fair amount of mobility content in addition to some of my other favorite topics.
Other than this introductory post I'll try to keep the signal very high and the content coming as frequently as I can. Here's what to expect in the coming weeks assuming I can find the time between a heavy workload, family, and other obligations:
- Ajax
- Skinning Calendar and Tabs (redux)
- Upcoming Calendar and Tabs bugfixes and enhancements
- My mile-long wishlist of control/extender ideas after I get my bug-count down
- Ajax unit testing
- Mobile
- Mobile UI wizardry
- BackgroundWorker for Compact Framework
- Mobile unit testing with Visual Studio 2008
- Workflow
- WPF
- Silverlight
If any of this interests you, subscribe and comment. Until then, happy coding.