Alessandro Del Sole's Blog

{ A programming space about Microsoft® .NET® }
posts - 1908, comments - 2047, trackbacks - 352

My Links


Your host

This is me! Questo spazio è dedicato a Microsoft® .NET®, di cui sono molto appassionato :-)

Cookie e Privacy

Disabilita cookie ShinyStat

Microsoft MVP

My MVP Profile

Microsoft Certified Professional

Microsoft Specialist

Xamarin Certified Mobile Developer

Il mio libro su VB 2015!

Pre-ordina il mio libro su VB 2015 Pre-ordina il mio libro "Visual Basic 2015 Unleashed". Clicca sulla copertina per informazioni!

Il mio libro su WPF 4.5.1!

Clicca sulla copertina per informazioni! E' uscito il mio libro "Programmare con WPF 4.5.1". Clicca sulla copertina per informazioni!

These postings are provided 'AS IS' for entertainment purposes only with absolutely no warranty expressed or implied and confer no rights.
If you're not an Italian user, please visit my English blog

Le vostre visite

I'm a VB!

Guarda la mia intervista a Seattle

Follow me on Twitter!

Altri spazi

I miei progetti open-source su GitHub

Article Categories


Post Categories

Image Galleries

Privacy Policy

English posts

Translations of the original Italian posts, for the largest worldwide diffusion possible :-)
Privacy Policy for Windows, Android and iOS Apps by Alessandro Del Sole

English Windows, Android and iOS apps created by Alessandro Del Sole use an Internet connection only to retrieve information from RSS feeds, to open Web pages. If an app uses maps, the Internet connection is only required to show information about a specific place. If an app uses Cloud services, the Internet connection is only required to save and restore the application data. No other usage of the Internet connection is made. Your personal information will be never collected nor transmitted over the Internet. Italiano Le app per Windows, Android e iOS create da Alessandro Del Sole usano la connessione a Internet solo per...

posted @ lunedì 2 luglio 2012 23:26 |

Vsi Builder 2008

The Visual Basic Tips & Tricks team is pleased to announce the availability of the newest release of a tool for developers called Vsi Builder, created by Alessandro Del Sole to our Community. Vsi Builder is a unique graphical interface tool about creating .vsi installation packages for redistributing and installing additional contents for Visual Studio (code snippets, macros, add-ins, projects/elements templates and starter kits, IDE settings) with a few mouse clicks! Vsi Bulder is a completely free tool and it’s for developers who use Microsoft Visual Studio, both in 2005 edition and 2008 edition! Moreover, Vsi Builder can be used by...

posted @ sabato 5 aprile 2008 18:38 | Feedback (18) |

Calendar example with ASP.NET

Most of the people who visit my blog well know that I'm not really interested in the ASP.NET world. But I wanted to understand something more about web applications in Visual Studio 2005, so I started to take a (little) look. Being helped by a great friend of mine, whose name is Alessandro Ardovini from Rome (I want to thank him in front of everyone of you, because he also agreed to prepare a download for what I'm going to describe), I've realized a simple Web application which implements a particular calendar. Controls allow to select a date via Comboboxes; on the other side you can select...

posted @ martedì 22 gennaio 2008 21:46 | Feedback (8) |

Announcing Vsi Builder v. 1.0

Introducing Vsi Builder Vsi Builder is an application for developers who use Microsoft Visual Studio 2005/2008 or single Express editions. It can build redistributable .vsi (Visual Studio Content Installer) installation packages to deploy additional contents for Visual Studio as code snippets, add-ins, macro projects, templates and starter kits, Visual Studio settings, debugger visualizers, toolbox controls. Even if it is not a code snippet editor, Vsi Builder allows you to create .vsi packages containing multiple code snippet, in a different way from Microsoft Snippet Editor 2005 which allows you to export to .vsi only one snippet at a time. By the way, you should still use this application...

posted @ domenica 9 dicembre 2007 17:18 | Feedback (27) |

WPF and the WrapPanel control

There is another interesting panel in Windows Presentation Foundation, called WrapPanel. Its main feature is to place controls from left to right, wrapping controls that go over the container itself width or of  the window width. Consider the following XAML: <WrapPanel> <Label Margin="10,10,10,10">Esempio di contenitore WrapPanel< SPAN>Label> <Button Margin="10,10,10,10" Width="50">Hello!</< SPAN>Button> <Button Margin="10,10,10,10" Width="150">Second Hello!</< SPAN>Button> </< SPAN>WrapPanel> This is what it produces on video: If you try to enlarge the window, this is what automatically happens: Obviously, if you reduce window's width the first button will be wrapped too. Alessandro

posted @ martedì 16 ottobre 2007 19:00 | Feedback (1) |

WPF and the Canvas panel

Until now we've seen a lot of code samples about Windows Presentation Foundation. In these samples we used to place controls particularly inside Grid and StackPanel panels. There is another exciting panel which WPF exposes and that is called Canvas. This panel is really interesting: width and height are always zero but children controls maintain their original size. Morevore, controls can just specify their position inside the container. In this way we have an absolute control positioning and controls maintain their size, just specifying their position in Canvas. Consider the following XAML: <Canvas Background="Orange"> <Image Canvas.Top="10" Canvas.Left="10" Source="logovbtt.gif" /> </Canvas> It produces the following result to...

posted @ lunedì 15 ottobre 2007 21:55 | Feedback (5) |

WPF: the Expander control

In Windows Presentation Foundation we can use a control called Expander, which is a sort of controls contanier and that can be expanded and closed just with a mouse click. Let's see a graphical sample. In Visual Studio 2005, type the following XAML: <Grid> <Expander Margin="10,10,10,10" Background="LightBlue"> <Expander.Header> Expander control sample </Expander.Header> <ListBox Margin="20,10,0,0" Background="LightGreen"> <ListBoxItem Content="First item"...

posted @ domenica 14 ottobre 2007 14:24 | Feedback (3) |

OpacityMask in WPF

In Windows Presentation Foundation, the most of controls expose a property called OpacityMask which allows to create transparency areas along the object itself and diffuse those areas in different manners. Let's see a practical sample on a Button. Start Visual Studio 2005 and create a new empty WPF project, then type the following XAML from within the Grid: <Button Width="220" Height="75"> <Button.OpacityMask> <LinearGradientBrush > <GradientStop Color="Transparent" Offset="0"/> ...

posted @ domenica 14 ottobre 2007 13:42 | Feedback (9) |

WPF: let your pc speak!

Windows Presentation Foundation allows computers to speak by using some features of the DirectX libraries according to Microsoft's implementation of Text-To-Speech technology. You just have to add a reference to the following assembly: System.Speech.dll. Let's see how it works. Open Visual Studio 2005 and create a new Windows Application (WPF) project either in VB 2005 or in C#. Then add a reference to System.Speech.dll. Let's draw a very simple button, which contains some text, writing the following XAML: <Grid> <Button Name="Button1" Width="250" Height="50" Click="Speak">Hello Windows Presentation Foundation!</Button> </Grid> We assigned a Button1 identifier which is necessary to interact with...

posted @ lunedì 8 ottobre 2007 21:52 | Feedback (3) |

WPF: Menus with different fonts

When implementing menus in WPF applications, you can assign different fonts (each with different properties) to each single header or command. Consider the following XAML: <DockPanel LastChildFill="True"> <Menu DockPanel.Dock="Top" VerticalAlignment="Top"> <MenuItem Name="FileMenu" Header="File" FontFamily="Script MT Bold" FontSize="14" FontStyle="Italic" FontWeight="Medium"> <MenuItem Name="FileVivaldiCommand" Header="Command with Vivaldi Font" FontFamily="Vivaldi" FontSize="16" FontWeight="Heavy"> <MenuItem.Background> <LinearGradientBrush> <GradientStop Color="Red" Offset="0" /> ...

posted @ lunedì 8 ottobre 2007 21:46 | Feedback (5) |

WPF: applying styles to Tooltips

Using styles in Windows Presentation Foundation, you can change also the layout of controls like Tooltip, those small text blocks which describe a particular object each time you pass over with the mouse pointer. Try to type the following XAML code from within a new empty WPF project, inside the Window element: <Grid> <Grid.Resources> <Style x:Key="MyTooltip" TargetType="{x:Type ToolTip}"> <Setter Property = "HorizontalOffset" Value="50"/> <Setter Property = "VerticalOffset" Value="50"/> ...

posted @ domenica 30 settembre 2007 16:15 | Feedback (5) |

Visual Basic version of the ASP.NET calendar control

Since I've received a lot of requests about, I'm proud to announce the availability of the Visual Basic version of the calendar control for ASP.NET, which I published in this previous post. You can download the source code at this address. A special thank to my great friend Alessandro Ardovini for helping me. Alessandro

posted @ martedì 25 settembre 2007 21:24 | Feedback (1) |

New links about some .NET 2.0 tools

The following are the new links you can use to download some important tools for .NET 2.0 and Visual Studio 2005. These tools where formerly published on the famous GotDotNet (which was shut down as many of you already know) and which I talked about also inside this blog but most of all in my Italian book Programmare con Visual Basic 2005 Oltre il Codice. So, it could be really useful to update your bookmarks. Here they are: Bootstrapper Manifest Generator, which you can download from here: Visual Studio Content Installer Powertoys, available here: Alessandro

posted @ martedì 25 settembre 2007 21:21 | Feedback (4) |

Microsoft Astoria - September 2007 CTP

Another product with a great codename from Microsoft. Astoria is a group of tools for Visual Studio 2008 whose pourpose is to make easier the creation of web services about data exchange, by using the HTTP communication protocol. Client application can then reach these services through the protocol's standards, via a local intranet or the Internet. If cliens are web sites, these must be realized according the Microsoft AJAX technology. If you want to try Astoria you must first of all install Visual Studio 2008 Beta 2. If you already did it and want to check out what Astoria is about, you can download...

posted @ sabato 22 settembre 2007 13:12 | Feedback (0) |

Microsoft Macro Assembler 8.0

Microsoft released version 8.0 of the well known MASM language which is based on .NET Framework 2.0. This download is about one year old but I discovered it just now :-) . It can be used only for non-commercial pourposes and before installing you need the presence of Visual C++ 2005 Express Edition. This is necessary because you can work with your MASM projects from within that visual environment. You can download MASM 8.0 at this address. I suppose that MASM compiler should be automatically installed if you installed also Visual C++ with Visual Studio 2005 Standard or higher. In fact the above download should be considered as...

posted @ sabato 22 settembre 2007 13:07 | Feedback (1) |

Visual Basic Pack for Visual Studio 2005 SDK

They finally did it!! a really great download! All the Visual Studio 2005 SDK code samples converted for Visual Basic 2005 and available for downloading. Who previously downloaded and installed the Visual Studio 2005 SDK well knows how code samples were dedicated only to C# and C++. This was a big limit, because through those instruments one could increase the IDE productivity by creating additional components, windows and custom language which can be recognized by Intellisense. You can download the Visual Basic Pack at this address, while you can read informations and how to use it in Visual Studio 2005 inside the SDK's blog, which you...

posted @ giovedì 20 settembre 2007 00:36 | Feedback (1) |

All the XAML code from this blog available for download

Since a lot of people have expressed their great interest to Windows Presentation Foundation, reading both this blog and the introductory Italian series of articles published on Visual Basic Tips & Tricks, I've realized a small zip file which contains all the XAML code I've posted until today. You can download the code at this address. There are not Visual Basic or Visual C# projects but separated .xaml code files which you can even add to your projects as you best like. Comments and disclaimer are written in Italian (you just have to consider the code is provided 'AS IS' with no warranties). If you think this is a good...

posted @ martedì 18 settembre 2007 22:18 | Feedback (0) |

BevelBitmapEffect in WPF

In Windows Presentation Foundation, according to the hyerarchical structure of XAML, we can apply a lot of graphical effects not only to images but also to controls. In this sample we're going to see how to use the BevelBitmapEffect effect, which renders the control to which it's applied in a 3D manner (we could say "buttonized"). We'll see how to apply it to an image and to a button. Open Visual Studio 2005 and create a new WPF empty project. The, type the following XAML code from within the Window element: <StackPanel> <Button Width="150" Height="60" Margin="10,10,10,10"> ...

posted @ martedì 18 settembre 2007 21:46 | Feedback (1) |

Styles inheritance in WPF

In Windows Presentation Foundation, styles support inheritance. In fact it's possible to declare a base style and styles which derive from the base. The main difference is that when defining a style you cannot specify the type of control the style is bound to. Or better, the type of object which can receive the style must be of type IFrameworkInputElement. The following sample will allow you to understand. First of all, we declare a base stile with XAML, from within the resources: <Style x:Key="MyStyle"> <Setter Property="Button.FontFamily" Value="Courier New"/> ...

posted @ venerdì 14 settembre 2007 19:17 | Feedback (0) |

Trigger example in Windows Presentation Foundation

In this previous article we saw an example of styles in Windows Presentation Foundation. By using a style, all the properties defined by Setter elements are unconditionally assigned to the controls which the style is bound to.  With Triggers, you can apply property values (defined by Setter elements) only if a particular contidition is evaluated. Take back the XAML code which I proposed in the above mentioned article, then add the following code before the final tag </Style>: <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter...

posted @ venerdì 14 settembre 2007 19:11 | Feedback (1) |

Style example in Windows Presentation Foundation

Windows Presentation Foundation implements a very important feature, which is represented by graphical styles. As you can imagine, a style defines a group of properties that can be assigned to a specified type of controls. These controls can then be uniformed to the defined style through a simple XAML declaration. Open Visual Studio 2005 and create a new WPF empty project. Then type the following code (or copy-paste from here :-) ):<Window x:Class="Window1" xmlns="" xmlns:x="" Title="WindowsApplication1" Height="300" Width="300" > <Window.Resources> <Style x:Key="MyStyledButton" TargetType="Button"> ...

posted @ venerdì 14 settembre 2007 19:03 | Feedback (2) |

WPF: buttons with inside videos

Today's Windows Presentation Foundation experiment is a retake of one we've seen some days ago, where we placed a skewed and bordered "still image" inside a button control. Let's now take a look at the same button, but this time we're going to start playing a video when the user clicks the button. Start Visual Studio 2005 and type the following code (deleting the Grid element, I prefer to use the StackPanel because this is the container that is used in the tutorials I find on the Internet :o) ): <StackPanel> <Button Margin="46,75,47,81" Name="Button1" Click="PlayVideo"> ...

posted @ martedì 11 settembre 2007 20:20 | Feedback (0) |

Which step for Vista Service Pack 1?

If you are interested in knowing something more about the benefits provided by Windows Vista's forthcoming Service Pack 1 (which is actually under beta testing) you can read further details in this blog which is dedicated to the new Microsoft OS, at the following address. You can also download a white-paper (available as .PDF and .XPS) which contains a list of all the system areas which will be affected by the new update package (and that should be released in a few months). Alessandro

posted @ domenica 9 settembre 2007 17:54 | Feedback (0) |

Gradient buttons in WPF

In Windows Presentation Foundation it's really easy to create buttons with gradient background at design-time. We can write the following XAML: <StackPanel> <Button Margin="10,50,10,50" Content="Click here!" Foreground="White"> <Button.Background> <LinearGradientBrush> <GradientStop Color="Yellow" Offset="0"/> <GradientStop Color="Red" Offset="0.5"/> <GradientStop Color="Blue" Offset="1"/> ...

posted @ domenica 9 settembre 2007 16:49 | Feedback (0) |

A new Microsoft web-site dedicated to Windows Presentation Foundation

A really cool new web-site from Microsoft, which is a replacement of two important places like (closed) and (still alive but redirects to the new). It's called and as the name suggests, everything's about desktop application based on both Windows Forms and Windows Presentation Foundation, the two main areas which it's divided into. You can find thousands of source code samples (code snippets, complete apps, controls), links to external articles and tools but the most impressive section to me, is the one regarding video tutorials. In most cases, you can download tutorials in different formats like Wmv, MPEG-4 (if you have a DVD...

posted @ domenica 9 settembre 2007 16:41 | Feedback (0) |

Hosting Windows Forms controls in WPF applications

In another article I gave a link to a MSDN Library page where you can find the list of Windows Forms controls and their Windows Presentation Foundation equivalent, observing that there is not an equivalent to each WinForms control. My friend Igor Damiani wrote a feedback describing some work-around techniques to this issue (we're waiting for a step-by-step.. :D ). During a Googling, I found another MSDN web page where it's explained how to host Windows Forms controls in WPF applications, by referencing the WindowsFormsIntegration.dll .NET 3.0 assembly. The source code shows how to host a MaskedTextBox control (both Visual Basic and C#). Here is the document: Instead, here...

posted @ domenica 9 settembre 2007 16:35 | Feedback (0) |

Windows Forms controls and WPF equivalent

If you began to take a look at .NET 3.x, particularly to Windows Presentation Foundation, you saw how this technology lets you use a lot of user controls, similarly to what we did in Windows Forms. The following MSDN Library page shows a list of Windows Forms controls and their WPF equivalent. Some of them have no one. It would be very interesting to understand how this can be work-arounded. I found this page while surfing the Internet searching for an HelpProvider equivalent but there is not one. Let's see what will be in the future... :-) This is the address: Alessandro

posted @ domenica 9 settembre 2007 16:29 | Feedback (0) |

WPF: setting controls background with ImageBrush

In Windows Presentation Foundation you can set controls background by using some objects that derive from the abstract class called Brush. In some previous posts we saw how to use GradientBrush and RadialGradientBrush classes. Instead, in this one we're going to see how to use the ImageBrush object to set a picture as controls background. I've used a Border that you can obviously replace with another one you like more, but for me it was necessary to show other techniques. By typing the following XAML:<Window x:Class="Window1" xmlns="" xmlns:x="" Title="WindowsApplication1" Height="292" Width="341" > ...

posted @ domenica 9 settembre 2007 02:11 | Feedback (1) |

XAMLPad and the Window object

As you probably know, with XAMLPad you can try XAML code on the fly, inside a Page object. While I was enjoying to experiment with this application, I tried to replace the Page object with Window, typical in the WPF Windows Applications. If we make this replacement, XAMLPad sends a warning, since the code cannot be run from within XAMLPad main window, while a new external windows is istantiated by pressing F5. Anyway, this kind of experiment could be really interesting if you want to try something specific for Windows applications. The following picture shows the output of my own experiment: Alessandro

posted @ domenica 9 settembre 2007 02:10 | Feedback (1) |

A great example of building a chat with both WPF and WCF together

A very impressive article on CodeProject. It shows the creation of a chat service with Windows Communication Foundation and how to use this service in a complete Windows Presentation Foundation application. In particular you can learn advanced WPF techniques like templates, styles and data-binding. This is a must-have. You can find it here: Alessandro

posted @ domenica 9 settembre 2007 01:57 | Feedback (2) |

WPF: A little sample of TabControl control

The TabControl in Windows Presentation Foundation is really versatile and highly customizable. It also implements very interesting features. In this little example we will examine some of them. Let's create a new empty WPF project and type the following XAML code inside the <Grid></Grid> tags (see comments below): <TabControl Margin="10,10,10,10"> <TabItem Header="With buttons"> <StackPanel> <Button Width="100" Height="50" Margin="10,10,10,10"> Hello! ...

posted @ domenica 9 settembre 2007 01:54 | Feedback (1) |

The OpenFileDialog control in WPF

I needed to implement an OpenFileDialog control in a Windows Presentation Foundation of mine. I read somewhere that WPF provides a specific control (different from the same-named in Windows Forms), so I went back to read this MSDN web page (which I also previously mentioned somewhere else in this blog) where Windows Forms controls and WPF equivalent are compared, to learn something more. So, I learnt that WPF's OpenFileDialog is just a wrapper of the native Win32 control. In fact, the complete name of this class is Microsoft.Win32.OpenFileDialog. Therefore, prepare yourself to use an old-style control (not much of that  Vista-style...). Even if it's possible to use...

posted @ sabato 8 settembre 2007 22:32 | Feedback (2) |

Viewbox control in Windows Presentation Foundation

The Viewbox control of Windows Presentation Foundation allows to automatically resize controls it contains, depending, for example, on the change of the window which contains the Viewbox itself. Try this simple little XAML snippet (e.g. by using XAMLPad): <Viewbox> <Button Width="150" Height="75"> Button in a ViewBox </Button> </Viewbox>Then, resize your window and you can see how the button gets automatically resized.Alessandro

posted @ sabato 8 settembre 2007 22:25 | Feedback (2) |

Powered by:
Powered By Subtext Powered By ASP.NET