Wednesday, November 24, 2004 - Posts

IE fan :)

In a period where the fans for Firefox are growing, there are some nostalgic fans of IE (or they simply hate Firefox success) that are building a support site like these Antifirefox.com. However, a nice forum guys!

P.S. I'm a Firefox lover but I hope on IE resurrection...

Visual Studio .NET 2005 and 2003 together...

This is a question I have to do...

I'm using Visual Studio .NET 2005 Beta 1 on a Virtual machine and all works good but... what could happen if I'll try to install it on the same machine where I've installed Visual Studio .NET 2003? The 1.1 and 2.0 Framework can live together without problems?

I need to setup a new machine at work to start working with VS2005 Beta and I need this feedback before starting...

Zooming your code in Visual Studio .NET

It's the time to blog this tip because I receive always the same question... what are these buttons in your Visual Studio .NET??

Some times ago I've written an article (in italian) to show a little tip for VS.NET and now I'll try to explain it...

How many times you're going to take a conference or a demo for a customer and you have received the question "Excuse me, can you increase the font size? We can't read the code..."? I think a lot of time...

The normal action to perform this task is going to the Tools --> Options --> Fonts and Colors menu of Visual Studio .NET and change the font dimension.

I've done exactly like these for a lot of time, but some months ago I've learned that VS.NET has a powerful editor for macros... So, why don't create a macro to perform this task? The great thing of a macro is that you can call it from a button placed on the VS.NET toolbar so, imagine how useful could be to have buttons on the VS.NET toolbar to increase or decrease the font size of the code window as you want.

Performing this task is quite simple...

We can create a new macro for VS.NET by going to the Tools --> Macros --> New Macro Project menu.

A new macro project is started. We've to choose the working directory and the project name and then push the Open button. The Macro Explorer window will magically appear to you.

On the Macro Explorer window you can see a module (Module1). Rename it as you want (I like to do so) and place the code above on it:

Imports EnvDTE
Imports System.Diagnostics


Public Module Presentazioni

Public Sub Incrementa() 'Increase the font size 
  DTE.Properties("FontsAndColors", "TextEditor").Item("FontSize").Value += 1 
End Sub

Public Sub Decrementa() 'Decrease the font size 
  DTE.Properties("FontsAndColors", "TextEditor").Item("FontSize").Value -= 1 
End Sub 

Public Sub Config_Presentazioni() 'Configuration used on presentations 
  DTE.Properties("FontsAndColors", "TextEditor").Item("FontSize").Value = 16 
End Sub

Public Sub Config_Lavoro() 'Configuration used at work
  DTE.Properties("FontsAndColors", "TextEditor").Item("FontSize").Value = 10 
End Sub 

End Module

 

As you can see, I've created a macro that works on the VS.NET environment properties and has 4 methods, 2 for increasing and decreasing the font size and 2 for automatically set font configurations to use at work (normally font size=10) and for presentations (normally font size=16).="/FONT">="/P">

After saving the project, now we've to create the buttons on the VS.NET Toolbar to use the macro. To do this, right click on the VS.NET Toolbar, Customize. on the Customization window, select the Commands tab and on the Categories list select Macros. On the right box you can see the list of your macros available with all their methods.

To add the buttons on the toolbar, just select the methods to add and drag&drop them on the VS.NET toolbar in the position you want. VS.NET will create a button for you. Right click on this button and you can customize it as you want (image, text etc.)

The final result is something like this:

This is what I have on my VS.NET. By pressing the + or - buttons you can easily increase or decrease the font size of your code window.

You can download the macro code from HERE.

I think it's a tip really useful for presentations...