Wriju's BLOG

.NET, Cloud and everything

Closing a Windows Form by pressing ESC key

While I was developing one Windows Forms application, it was required for me to close the popup forms when user will press ESC key. I tried adding the Form’s KeyPress event. It was not working as expected. Then I thought I should write a code to find all the controls to my form and add… Read more

NotifyIcon : Display Windows Form in System Tray

While talking to different people I get this question. And in Visual Studio it is very easy to do,   You need Windows Forms Application, then drag and drop NotifyIcon there. Set one icon with that control so that it is visible,   public partial class Form1 : Form {     public Form1()     {… Read more

Setup and Deployment : Custom Action to Capture User Input

Purpose Users are allowed to pass Product Key while installing in .msi. During that we want to capture it for registration to avoid piracy. Challenges When we use “Customer Information” dialog in “Start” action, it has “SerialNumberTemplate”. But capturing information from there is really tough as mentioned in the article http://support.microsoft.com/kb/253683/en-us. So we have to… Read more

LINQ to XML : Understanding Annotations

Annotations are used for private use. It does not directly associated and known as Black Box in XML world. This can also be considered as meta tag. Below is an example on how it can be handled. I have created a sample Windows Applications and will try to capture my understanding. /// <summary> /// Class… Read more

Windows Forms – Enable Shortcut Key all over the Form

Windows Application and shortcut key are synonyms. People prefer to use shortcut keys for faster activity. Assume you are in a text box and you want to hit F5 to reload the form. You do not want to move your mouse cursor. So what you will be doing is that you will be adding “Key… Read more

Programmatically invoking the Live.com search

Live.com you need to automate that in your Windows application. You will use the WebBrowser control. This is a very powerful control and allows us to control things through DOM. Here is a small code which insert values to the live.com’s seach text box and clicks the “Go” button. I have created a windows forms… Read more

LINQ to XML : Changing connectionString in app.config

When you create data bind application using wizard in Windows Forms application and connection string gets added to you settings file. Now you may be interested in changing that connection string but problems, 1)     The connection string in settings has an Application Scope so it is ReadOnly property. You modify and remove “ReadOnly” from .vb… Read more

Orcas Beta 1 ADO.NET vNext First Look

What is ADO.NET vNext or Entity Framework? It has been a long journey for the application development and data access. Starting from DLib,… DAO, ADO, ADO.NET. Now the world is for ADO.NET vNext or Entity Framework model. This is to increase the level of abstraction and avoid the change mismatch. In Orcas the designer is… Read more

ClickOnce Deployment : System.Deployment API

Applied to: Visual Studio 2005   ClickOnce is the deployment revolution for SmartClient applications. This is very cost effective solution for Smart Client applications. Support cost is very less and the deployment is per user basis. So user does not need Administrator right to install the application and security sandboxing is integral part to it…. Read more

Generics : An easy way to bind the data in DataGridView

Applied to: Visual Studio 2005 [C#]   Yes this is Generics. The concept which helps us to create collection easily and elegantly. Two steps to create the list is demonstrated here.   Step 1:   You have one object say for list of products which contains three properties Name, Quantity and Price.   using System;… Read more