Instant indentation in Visual Studio

29 04 2011

This is a kind of “tip of the day” which I should’ve shared sooner. One of the most common shortcuts I use in Visual Studio is this:

Ctrl+K Ctrl+D

This magic little piece of key-punching instantly and perfectly indents all the code on your current page. Go on, try it out. You’ll never manually indent code again.

If you would like to name your firstborn either Control-KD or Viktor junior, that’s ok.

image





Snipping databound properties

6 08 2010

Long time no see Internet! Hope your summer has been as good as mine and that you’re at least as caffeinated and motivated as I am.

1280965856882Snippets are almost as tasty as bacon, and less calories

I just learned about snippets and wanted to share this wonderful coding aid with everyone. Let’s Go!

Read the rest of this entry »





Silverlight 4 Webcam Demo

22 02 2010

During my visit to Finland last month, I got the opportunity to demonstrate some of the new features in Silverlight 4 in demo-form. Today, I’ll review the webcam demo.

Silverlight 4 webcam demo

Read the rest of this entry »





Silverlight 4 dropping, rightclick, printing demo

9 12 2009

For my presentation one week ago, I showed two demos. I thought I’d share one of those with you now. It’s calles “What we talked about at the christmas party” and highlights in a simple way, three new features of Silverlight 4; Dropping, right clicking and printing.

DEMO

Let’s begin!

Read the rest of this entry »





Silverlight Out of Browser with new WebBrowser

27 11 2009

Today I’m making a demo application. It’s a simple PDF reader in Silverlight and it uses two new features. The Silverlight Out Of Browser (SLOOB) with elevated permissions, and the WebBrowser Control. Those of you who’ve written some WPF might already be familiar with the WebBrowser control and what it can do. In Silverlight, it’s basically an html-renderer for when you’re out of browser.

SLOOB

Read the rest of this entry »





Adding right-click functionality in Silverlight 4

24 11 2009

Not having the right mouse button available has been a hassle for both Silverlight and Adobe Flash since their inception. Flash has had the ability to customize their right-click context menu to some degree but never true right click event handling. With Silverlight 4, Silverlight will have true customizable event handling for the right mouse button. I know this might be a small step for event handling, but it’s a giant leap for rich Internet applications.

SmallStepForEventHandling

To do this in Silverlight 4, this is the code you’ll need to use:

Read the rest of this entry »





Scott Guthrie is coming to Sweden

18 11 2009

One of the .Net worlds most well-known personas ScottGu is coming to Sweden. He is giving a five (!) hour long lecture on VS2010 and other magical things the 2nd of December. Participation in the event is free. Go get registered now right…

HERE

 

 

Screaming_Fan





Imageboard viewer almost done – Needs tweaking

16 11 2009

As I mentioned before, I’ve been working on an image extractor for a specific image board as a way to hone my .net skills. It’s almost done in the sense that “it works on my computer”.

image

This is the look of it at the moment. The gradient background is kind of an inside joke and those of you who get it, good for you.

The idea is for users to be able to look at multiple pages of image content without having to click through pages or read lots of useless banter. Take for instance this wallpaper-board. The user can request any number of available pages to be presented and then click on an image to see it in full resolution. Very effective.

image

My problem at this point is that since I developed the app using Visual Studio 2010, all references are to .net framework 4.0 and unusable to most people. A friend of mine who tested the application also complained about it stopping when trying to save the pictures. I guess the apps main thread stalls while downloading. That’s something else I’ll have to look at.





“Boxmarking” in Visual Studio 2010

14 11 2009

I’ve been trying out the Visual Studio 2010 beta for a week now and I love it. One of my favorite features is the boxmarking which VS now allows. This is nothing new but is incredibly useful when editing code.

In my sideproject, the Imageboard-Viewer, I wanted to apply a Style template to a list of ComboBoxItems. In Visual Studio 2008, I’d been forced to copy paste the text and change rows a million times (there are more items than visible here, although maybe not a million) .

imageWhat I did instead was hold down Alt while dragging a thin vertical box and pasting my code once. This resulted in the same text being pasted to each row.

image

I also got a chance to use boxmarking when copying multiple values. I wanted to set the content of the ComboBoxItems according to names. As is visible in the above picture, I had several different values to copy.

image Boxmarking makes this an easy and quick task to complete. Imagine the time saving possibilities when handling hundreds of rows at the same time.

Now I just write the word Content and paste my names

image





Pasting code into WordPress

13 11 2009

Pasting code into WordPress is harder than I thought. I’m gonna try an addin to Visual Studio called CopySourceAsHtml. Let’s see how it works out with VS2010 BETA.

[Continued] Seems you couldn’t use the addin with VS2010 but it works great with VS2008.