Wednesday, May 25, 2011

Free C# Book

In this book, you will learn how to write and compile C# programs, understand C# syntaxes, data types, control flow, classes and their members, interfaces, arrays, and exception handling. After completing this book, you should have a clear understanding of the purpose of C# language, it’s usages, and how to write C# programs.

http://www.c-sharpcorner.com/UploadFile/mahesh/csp08202007084545AM/csp.aspx

Tuesday, May 24, 2011

Why Every Developer Should be a Good Tester

I have seen repeatedly, a developer a.k.a. programmer a.k.a. coder assumes that testing is not a part of his day-to-day job. His job is just write code and passes it to the testing team and the testing team will find all bugs and problems in the code.

http://www.c-sharpcorner.com/Blogs/5266/why-every-developer-should-be-a-good-tester.aspx

Monday, May 16, 2011

Add X-Power to Your XML Development with Liquid XML Studio 2011

Today, more and more applications are migrating to the Web and the Cloud services are taking over the world; XML has become one of the key and vital parts of the data exchange mechanism. Whether you are developing client centric applications or building a consumer product, you will end up working with XML.

http://www.c-sharpcorner.com/uploadfile/mahesh/7411/ 

Saturday, May 14, 2011

Google Chromebook: Windows, iPad Killer or Just one more Tablet

Google Chromebook: Windows, iPad Killer or Just one more Tablet

Long awaited and announced Google Chromebook will hit stores (Best Buy) on June 15. So what makes Chromebook different than other tablets?

Sunday, April 3, 2011

C# TabControl

TabControl Control

The TabControl manages tab pages where each page may host different child controls. In this article, I will demonstrate how to create and use a TabControl in Windows Forms.

I wrote an article Working with Windows TabControl with C# in 2003 using .NET 2.0 and since then, things have been changed. This article is written using Visual Studio 2010.

Creating a TabControl

We can create a TabControl control using a Forms designer at design-time or using the TabControl class in code at run-time or dynamically.

Design-time

To create a TabControl control at design-time, you simply drag and drop a TabControl control from Toolbox onto a Form in Visual Studio. After you drag and drop a TabControl on a Form, the TabControl1 is added to the Form and looks like Figure 1.


TabControl1.gif

Figure 1

A TabControl is just a container and has no value without tab pages. As you can see from Figure 1, by default two Tab Pages are added to the TabControl. We can add and remove tab pages by clicking on the Tasks handle and selecting Add and Remove Tab links as you see in Figure 2.


TabControl2.gif

Figure 2

Add Tab link adds next tab page and Remove Tab removes the current tab page from a Tab Control. We will discuss tab pages in more details later in this tutorial.

Run-time

TabControl class represents a tab control. The following code snippet creates a TabControl and sets its Name, BackColor, ForeColor, Font, Width, and Height properties.

C# Code:

// Create a TabControl and set its properties

TabControl dynamicTabControl = new TabControl();
dynamicTabControl.Name = "DynamicTabControl";
dynamicTabControl.BackColor = Color.White;
dynamicTabControl.ForeColor = Color.Black;
dynamicTabControl.Font = new Font("Georgia", 16);
dynamicTabControl.Width = 300;
dynamicTabControl.Height = 200;

Once the TabControl control is ready with its properties, we need to add it to a Form by calling Form.Controls.Add method. The following code snippet adds a TabControl control to the current Form.
C# Code:



Context Menu in C#

ContextMenuStrip Control

The ContextMenuStrip control provides functionality of context menus in Visual Studio 2010 and .NET 4.0. A context menu is also known as a popup menu. A context menu appears when you right click on a Form or on a control.

In the previous versions of .NET, the context menu functionality was provided by the ContextMenu control. In .NET 4.0, the ContextMenu control is replaced with the ContextMenuStrip control.

In this article, we will discuss how to build context menu enabled Windows applications using ContextMenuStrip control in Visual Studio 2010.
Creating a Context Menu
To create a ContextMenuStrip control at design-time, you simply drag and drop a ContextMenuStrip control from Toolbox onto a Form in Visual Studio. After you drag and drop a ContextMenuStrip on a Form, the ContextMenuStrip1 is added to the Form and looks like Figure 1. Once a ContextMenuStrip is on the Form, you can add menu items and set its properties and events. If you noticed in Figure 1, first item of the ContextMenuStrip has text Type Here. You can actually start typing here.
ContextMenu1.gif
Figure 1
If you notice in Figure 2, I type couple of menu items. As soon as you select a menu item, you will see automatically sub menu items areas are editable and you can keep going as many levels you like. I add two menu items and two sub menu items.
ContextMenu2.gif
Figure 2
We can also create context menus at run-time. Even though you can create a ContextMenuStrip at run-time, it is recommended you create at design-time and then set the properties and methods at run-time.
First step to create a dynamic ContextMenuStrip is to create an instance of ContextMenuStrip class. The following code snippet creates a ContextMenuStrip control object.
C# Code:
ContextMenuStrip PopupMenu = new ContextMenuStrip();
VB.NET Code:
Dim PopupMenu As New ContextMenuStrip()
In the next step, you may set properties of a ContextMenuStrip control. The following code snippet sets background color, foreground color, Text, Name, and Font properties of a ContextMenuStrip.
C# Code:
PopupMenu.BackColor = Color.OrangeRed;
PopupMenu.ForeColor = Color.Black;
PopupMenu.Text = "File Menu";
PopupMenu.Font = new Font("Georgia", 16);
VB.NET Code:
PopupMenu.BackColor = Color.OrangeRed
PopupMenu.ForeColor = Color.Black
PopupMenu.Text = "File Menu"
PopupMenu.Font = New Font("Georgia", 16)
Once the ContextMenuStrip control is ready with its properties, the next step is to add the ContextMenuStrip to a Form. To do so, first we set ContextMenuStrip property and then use call the Show method to display the ContextMenuStrip.
The following code snippet adds a ContextMenuStrip control to the current Form and displays it when you right click on the Form.
C# Code:
this.ContextMenuStrip = PopupMenu;
PopupMenu.Show();
VB.NET Code:
Me.ContextMenuStrip = PopupMenu
PopupMenu.Show()

Setting ContextMenuStrip Properties
After you place a ContextMenuStrip control on a Form, the next step is to set properties.




Sunday, March 27, 2011

Smart Phones, Software Development and the Future

Original Post:

Smart Phones, Software Development and the Future

The market is flooded with new, shiny and do-it-all smart phones and every manufacturer is trying to woo new customers with new ideas, designs and features. Apple's iPhone, Microsoft's Windows Phone 7, Google's Droid, and Rim's BlackBerry are a few in the list.

SmartPhones.gif


Today, I find my iPhone being one of the most common parts of my life. If I leave it for 15 minutes, I feel like I have left a body part somewhere. To give you an idea, here is a list of the tasks I do with my iPhone.


  • Obviously, Phone calls
  • Text messaging – I found it useful even when there is noise, you can still text.
  • Emails – I check most of my emails while I am doing some other activities such as at the Gym, waiting somewhere or even while watching TV or waiting for Neel's school bus. This saves me lot of time and hassle of going to my computer.
  • Photos and Videos
  • Music – I use all the time at the GYM.
  • Games – Neel and I play lot of games on it. I play two games only, Angry Birds and Chess.
  • All schedules and reminder
  • Maps and directions
  • All calendar events
  • Alarms
  • Online banking and stock market updates
  • Stop Watch – I use all the time when I am having Neel practice at the field.
  • Weather – I check it every day, a few times a day to keep me up to date with the weather.
  • News – Check news online
  • Website updates – I check C# Corner and other websites
  • Messengers chats
  • Shopping research
Smart phones market is the fastest growing business today and probably for the next decade.Nielsen predicts that the smart phones will take over the regular phones in year 2012.
SmartPhones2.gif


IDC predicts, the he worldwide market for smart phones expected to grow 55.4% this year compared to 2009 amid better than expected demand. This is 10% higher than the previous forecast from the International Data Corporation.

IDC prediction also predicts that by 2014, the Android and Windows Phone will take over the iOS (iPhone) by a big number and Google's Android will lead the way.



As a developer, you should think about development of smart phones now. Smart Phones development is one of the Top 6 Software Development Trends in 2011. Today, the market is flooded with many Tables. Check out my blog Are Tablets the Future?

I have been a Windows Client applications developer for almost 14 years now. I have also been developing Web application for a while but recently, I have switched my focus to smart phones. Novell, recently launched the MonoDroid that I am using to build Android based applications using C#. I am using the MonoTouch iPhone/iPad development.

Cheers!

Wednesday, March 16, 2011

7 Golden Rules to Impress Your Project Leader

7 Golden Rules to Impress Your Project Leader
There are several ways to impress your boss. You could sing, dance or buy him/her a beer - it all depends on what kind of boss you have. How about losing a tennis game? For our sake, we will focus on impressing a technical boss, such as your team leader, technical leader or project leader, the person who is responsible for assigning you work and reviewing your work the first time you deliver it. The person can also be a direct client you are working for.
With that said, this comes from within me. If I am a client or a project leader or a technical leader, this is what I would look for.
DOS days are gone when the definition of an expert programmer correlated with your typing speed and memory. The faster you type without looking at manuals (command syntaxes), the sharper a programmer you were considered.
Those days are long gone. Welcome to the Visual world. Welcome to the RAD (Rapid Application Development) and RIA (Rich Internet Applications) world. Welcome to the Web 2.0.
Today, you do not need to memorize commands and syntaxes. Tools such as Visual Studio 2010 Intellisense, ReSharper and SQL Prompt are here for you.
So what exactly do you need to focus on?
A computer program solves a problem. First, you need to find the most efficient and effective solution to your problems. Anybody can write code. Yes, that is true. Nowadays, anybody can write code, but the winner is the one who writes the most efficient code.
Check out my blog Top 10 Things Every Developer MUST Do
Besides writing efficient code, what else should you keep in mind?
You need to know the following:
  • What tools and technologies are most efficient for your project?
  • What user interfaces are best suited for your application?
  • Have you commented and formatted your code?
  • Have you used the latest features provided by the tools and technologies?
  • Have you tested your code?
So how can you improve? Here are some of the pointers I noticed from my personal experience. I have been involved with every aspect of the software development life cycle from meeting non-technical clients, understanding their needs, writing detailed specifications, writing design documents to coding, testing, installation and development. I have also managed several projects simultaneously with in-house developers, offshore teams, and a blend of both.
Here are my 7 golden rules in my book:

Continue reading ...

Monday, February 28, 2011

Charting in WPF

This tutorial demonstrates how to draw various charts including line chart, bar
chart, column chart, area chart, scatter chart, and pie chart using WPF and C#.

http://www.c-sharpcorner.com/UploadFile/mahesh/WPFCharting11272009153918PM/WPFCharting.aspx

Charting in Silverlight

This tutorial demonstrates how to use charting applications in Silverlight using Silverlight Toolkit. First you will learn how to get started with the Silverlight Toolkit and then create bar chart, line chart, pie chart, column chart, and scatter chart in a Silverlight application.

http://www.c-sharpcorner.com/UploadFile/mahesh/Slcharting11092009104755AM/Slcharting.aspx 

Sunday, February 27, 2011

DataGrid in WPF

This article shows you how to create and use a DataGrid control in WPF and XAML.

Note: This article is written using Visual Studio 2010 and .NET Framework 4.0.
Introduction

DataGrid element represents WPF DataGrid control in XAML.

<DataGrid
/
>

When you drag and drop a DataGrid control from Toolbox to your designer, position the control, this action adds following code to XAML. The Width and Height properties represent the width and the height of a DataGrid. The Name property represents the name of the control, which is a
unique identifier of a control. The Margin property sets the margin of placement of DataGrid on the window. The following code snippet sets the name, height, width, and margin of a DataGrid control.
<>
<DataGrid Height="148" HorizontalAlignment="Left" Margin="12,21,0,0" 

         Name="dataGrid1"
VerticalAlignment
="Top" Width="225"
/>
                                                      
Listing 1

Friday, February 25, 2011

Building your first Windows Phone 7 Application

Building Android Applications using C#

Building Android Applications using C#
MonoDroid is a software product developed by Novell to build Android based mobile applications using C# and .NET. To install and work with MonoDroid, you need Visual Studio 2010. MonoDroid works as an add-on of Visual Studio 2010. Once installed successfully, the MonoDroid project templates are available in Visual Studio 2010. MonoDroid does not work with Visual Studio
Express.
In this tutorial, we will learn how to build our very first Android based application using MonoDroid and Visual Studio 2010.
Installing MonoDroid
You can download the latest version of the MonoDroid from www.monodroid.net and follow the installation instructions here: http://monodroid.net/Installation
Once you have successfully installed the Android SDK, MonoDroid and all required software, you are all set to build your very first Android based application using C# and .NET.

TreeView in WPF

This tutorial shows you how to create and use a TreeView control available in WPF and XAML.
Introduction
A TreeView represents data in a hierarchical view in a parent child relationship where a parent node can be expanded or collapse. The left side bar of Windows Explorer is an example of a TreeView.
The TreeView tag represents a WPF TreeView control in XAML.
The Width and Height properties represent the width and the height of a TreeView. The Name property represents the name of the control, which is a unique identifier of a control. The Margin property tells the location of a TreeView on the parent control. The HorizontalAlignment and VerticalAlignment properties are used to set horizontal and vertical alignments.
The following code snippet sets the name, height, and width of a TreeView control. The code also sets horizontal alignment to left and vertical alignment to top.


http://www.c-sharpcorner.com/uploadfile/mahesh/wpftreeview08202008231544pm/wpftreeview.aspx

Learn C# Programming

Wednesday, February 23, 2011

Top 6 Software Development Trends in 2011

2011 is here and I have noticed a tremendous upside in Software development. You are golden if you are working with cutting-edge technologies. Whether you are looking for a better paying job or
building your own applications, you must know what is hot now and what is coming
in the near future.

Here is a list of the top 6 top trends in Software Development that will make you rich in the very near future:
  1. Cloud Computing and SaaS
  2. Smart Devices Development
  3. WPF Replacing Windows Forms
  4. SharePoint and Office Integration
  5. Social Media Integration
  6. Bulk Data Management and Security
Cloud Computing and SaaS
A few years ago, when SaaS (Software as a Service) was introduced, it did not seem like a good idea and at that time, I questioned myself, why would I give my personal information and customers’ data to Google or Microsoft? Well, here we are. Now it all makes sense.
Cloud computing not only saves you lot of time and money but also makes it easy for small businesses and individuals to avoid the big hassle of software purchases, installations, and maintenance. 
Here are two good articles on basic understanding on cloud computing and Saas:
Visual Studio 2010 now supports Cloud programming and comes with project templates. Check out
A first look at programming Cloud-based applications using Visual Studio 2010 .
Microsoft's answer to cloud computing is Windows Azure and SQL Azure. Windows Azure is the Windows operating system that is developed to manage cloud servers and the SQL Azure is the SQL Server that supports cloud computing.
What is Cloud Development?
Here is MSDN's definition:
Cloud computing refers to computers and applications that run remotely and are accessed over the Internet. In cloud computing, virtual machines run in large data centers and replace physical PCs and servers. By aggregating the computing needs of many users within a single center, economies of scale are achieved that result in significant benefits for everyone. Some of these benefits include lower power utilization, simpler setup and maintenance, and easier upgrades to capacity and performance. Many applications can run unchanged as you redeploy
them from local desktops or servers to the cloud. Some applications do need to be updated to adapt them to running remotely in a more distributed computing environment, and some entirely new types of applications are being enabled by cloud computing.
Mobile Development
Smart Phone development is in demand and industries can't t get enough of smart phone devices
as well as developers. The iPhone, iPad, Windows Phone, Android and BlackBerry are the major names in the smart devices development. The bad (actually good for us developers) part is that every device manufacturer has their own API that makes it difficult for developers to learn everything. So if you want to be in demand, pick a device and get into this niche market. You can just be an iPhone developer and have enough work to keep you busy for the next several years.
The best part is, the demand is growing and will grow more and more every year. The iPhone, Android, and Windows Phone 7 developers are in high demand today. I have lot of resources on Windows Phone 7, and I have started working on Android and iPhone development. 
I am sure you have heard of Mono? I am not talking about Mono, the kissing disease. Mono is a Framework developed by Novell for Linux developers to write C# and .NET applications. Novell also developed the MonoTouch and the MonoDroid products that can be integrated with Visual Studio 2010 and used to build iPad/iPhone and Android based applications.
Here are two blogs I wrote about MonoTouch and MonoDroid:
We are also adding more articles, tutorials and other resources on these two technologies. Check out  MonoTouch and MonoDrod Development section on C# Corner to find more resources on these
technologies.
WPF is replacing Windows Forms.
If you are a Windows Forms developer, it is time to move to WPF (Windows Presentation Foundation). Most of the new project requirements I see are in WPF, and many companies are igrating their Windows Forms applications to either Web or WPF. The reason is simple. You can do pretty
much everything in WPF and the graphics and rending have improved a lot.
Check out a forum discussion Future of Windows Forms to learn more about the future of Windows Forms and WPF.
You can find hundreds of articles and tutorials in the Learn WPF section of C# Corner.
SharePoint and Office Integration
SharePoint 2010 and Office 2010 are two of the products Microsoft has worked hard on, and they’ve actually done a great job. Today, SharePoint 2010 has become the go-to product for small to medium business. SharePoint 2010 is not a content or file management system anymore. Using
SharePoint 2010, you actually build Intranet based files and document sharing systems, social and blogging websites and much more.
Social Media Integration
Social Media Integration has become a necessity for all businesses. Today, if you look at any website, small or large, retail or community, technical or a book store, you will see Social Media
integration options. The Integration with Facebook, Twitter, and LinkedIn are very common requirements these days. Facebook, Twitter, LinkedIn and most of the social networking websites provide APIs to connect with the websites and share data. Social Media Integration developers are in high demand already today.

Bulk Data Management and Security
Data management and security is in high demands today. Every business and individual is looking for the Web for anything they need. The number of Internet users is growing, and the data transfer and data storage on the Internet is growing. That brings bulk data management and data security concerns. These two trends with the demand of high speed Internet will grow and grow. There is no looking back from here on out.
Check out these good readings on top trends for year 2011.  
About the Author
Mahesh Chand is a published author, consultant and Microsoft MVP for 6 consecutive years. Mahesh
is also a founder of
C# Corner and Mindcracker Network, one of the most active online communities for Microsoft developers. When Mahesh is not writing technical articles or blogs, he enjoys Basketball, Football, and Cricket.