Tag: C#

Convert C# code to JavaScript

Convert C# code to JavaScript

There are some tools which convert C# code to JavaScript. Obviously these will only be useful if your code is not tightly coupled with any C# library as the library won’t be available in JavaScript. These conversion tools may come handy for model classes or any other logic which is, for the most part, independent…

Read More Read More

Developed Custom .Net Font Dialog

Developed Custom .Net Font Dialog

Developed a Custom FontDialog as an alternative to the standard .Net FontDialog. Key advantage of CustomFontDialog is the full control over look and feel as it is open source. Source and binary files are available at sourceforge. CustomFontDialog avoids ‘This is not a True Type Font’ exception that affects the standard dialog in some cases. Most probably the exception…

Read More Read More

Quick and dirty way of creating Numeric TextBox in .Net (C#)

Quick and dirty way of creating Numeric TextBox in .Net (C#)

Handle KeyDown event of the TextBox and set the e.Handled property to true if the character is not numeric.   Switch cases list all desired characters which will be displayed, rest of the characters are ignored. If additional characters are required, they may be included as switch cases. For instance, negative sign may be allowed…

Read More Read More

How to embed chrome browser in .net application

How to embed chrome browser in .net application

Chrome browser can be embedded in native application taking a hybrid approach to development where application is partly developed in native technology and partly in web. This has several advantages: Salvage the existing investment in HTML/Javascript projects. The part of application written in web technology is platform independent. This is very important due to variety…

Read More Read More

Custom .Net (C#) Collection: Recently Used List

Custom .Net (C#) Collection: Recently Used List

I came across a situation where I needed a collection which can hold recently used objects of a particular kind. For instance, recently opened files, recently used fonts or colors etc. Such a list should demonstrate following behavior: List should have a limited size (or call it maximum size). As list grows beyond the maximum…

Read More Read More

Handle arrow key events in Windows Forms .Net (C#)

Handle arrow key events in Windows Forms .Net (C#)

Pressing of a key is detected and handled in Windows Form using KeyPress, KeyDown or similar events. But these events does not fire when arrow keys are pressed. One way to get around it is to set KeyPreview as true for your Form. In many cases, this also doesn’t work, for instance, when you have…

Read More Read More

Excel Add-in for Exporting data to XML

Excel Add-in for Exporting data to XML

Download ExcelExportXML-Setup – 221.11 KB Download ExcelExportXML-Source – 328.11 KB Introduction ExcelExportXML is a Microsoft Excel 2010 Add-in that generates XML data from excel sheet. It is developed in Visual Studio 2010 using C#. It is a very simple add-in. To understand how to works, consider an excel sheet having following data. Country Capital Continent…

Read More Read More

Writing Add-in for Microsoft Excel 2010 using Visual Studio 2010

Writing Add-in for Microsoft Excel 2010 using Visual Studio 2010

Using Visual Studio 2010 Professional, creating Excel Add-in is pretty simple. Following are the steps I followed for writing an Add-In for exporting Xml: Step # 1 Create new project of type ‘Excel 2010 Add-in’. The project will have a class file called ThisAddin.cs. Step # 2 For creating a button on the Excel ribbon,…

Read More Read More

Microsoft Visual Studio LightSwitch

Microsoft Visual Studio LightSwitch

Visual Studio LightSwitch is a new tool from Microsoft for developing business applications. Currently available development technologies from Microsoft (like VS C#) are general purpose and can be used to develop a wide variety of applications. LightSwitch, on the other hand, is focused on simplifying development of business applications by handling the basic plumbing itself.…

Read More Read More