Thursday, June 19, 2008

Develop the User Interface!

Adding controls and polishing the user interface is as easy as dragging and dropping with the Visual Studio IDE. Lets add a picture your dad likes to the form.

1.Use the PictureBox Control to add a picture.

Click on the PictureBox control in the ToolBox, and drag it onto your form. In the background, the IDE has added code to Form1.Designer.cs for a new picture control.


2. Set the PictureBox to Zoom mode

Every control on your form has properties that you can set. Click the little black arrow for a control to access these properties. Change the PictureBox's Size property to "Zoom" to see how this works!

3. Now Insert the Picture:

Now to insert your Dad's favourite Picture, click on the PictureBox properties arrow and select Choose Image. Click Import, find your picture on the hard drive and you're all set!!!


Visual Studio, Behind the Scenes!

Every time you do something in the VS IDE, the IDE is writing code for you! When you inserted the picture and told the Visual Studio to use the image from your hard disk, VS created a resource and associated it with your application. a resource is any graphics file, audio file, icon or other kind of data file that gets bundled with your application. The graphic file gets integrated into the program, so that when its installed on another computer, the graphic is bundled with your application. The graphic file gets integrated into the program, so that when its installed on another computer, the graphic is installed along with it and the PictureBox can use it.

When you dragged the PictureBox control onto your Form, the IDE automatically created a resource file called Form1.resx to store that resource and keep it the project. Double click on this file on the Solution Explorer tab and you'll be able to see the newly imported image!

Add to the Auto-Generated Code!

The IDE creates a lotta code for you, but you'l still want to get into the code and add to it! Let's set the picture and show an About message when the users double click on it.

Make sure you've got your form showing in the IDE and double click on the PictureBox Control. You should see some code pop up that looks like this:


You are ready to run your application!

Press F5 to run your application or click the green arrow button on the toolbar to check out what you've done so far. This is called Debugging which just means running your program from the IDE. You can stop the debugging by pressing the Stop Debugging from the Debug menu or clicking the toolbar Stop button.


Yay!! We've built a form and created a PictureBox which pops out a message box when its clicked on! In the next post, we'll add all the other fields from the card like contact name and address and for that we need to create a database. So, we're going to jump from the .NET Visual objects straight to the Data Storage section!!

Help your Dad with Address book Management! ---> Part 1

The title sounds strange hun? Wait! You are at the right blog.. Yes it is geek under construction! Now take away the blank look off your face and realize that we are gonna build our first project in Visual Studio.. So why not it be for your dad?? Although Fathers day gone by on June 15th, its ok.. Lets give him a nice belated gift by helping him with his address book and also show off your new found skill... What do you say?? So lets get started!


  1. Your dad needs to run the application from his laptop assuming that you are building on your laptop or your machine. So, he ll need an installer to make sure that all of the right files get into each others machine
  2. Now, your mom is also an integral part of your family.. She might have common contacts as that of your dads. So, lets make that everybody in the family get to access the address book in case of some emergency.. So, we figure out that building a database is the best way that everyone can see the data and your dad can just keep one copy of the contacts.
Here's What you're gonna build!

You're going to need an application with a Graphical User Interface(GUI), objects to talk to a database, the database itself and an installer! It sounds like a lotta work but you ll build all of this in no matter of time! Lets see the structure of the program that we are gonna build!


Go ahead! Start up Visual Studio, if you haven't already.. Skip over the start page and and select New Project from the File menu. Name your project "Contacts" and click OK.

This is how it'll look!


As soon as you save the project, the IDE creates a Form1.cs, Form1.Designer.cs and Program.cs file when you create the new project. It adds these to the Solution Explorer window and by default, puts those files in My Documents\Visual Studio 2008\Projects\Contacts\. I ve decided to save it in C:\Contacts\.

You get the following screen!

Ok! Now we are settled with examining the behind the screen operations and the user needs and VS.. Opening and creating a project.. So lets see how we develop the user interface and integrate what we have decided to build! We ll do that in the next post!! Till then keep figuring out and experimenting!!!

Our First Venture!

Hey folks..

U must have all got an idea about what VS IDE does and other basic things. Enough of all the blah blah talk and lets get into some action! I guess everyone will be expecting that our first venture must be a HELLO WORLD program of C#.. Nopes.. I know you guys must have had a doze of C++ or atleast C.. So I assume that I do not wanna bug u with the cliched "Hello World" program first. Lets get into some Windows Form building and then jump into core C#. Yo man! Wat are we waiting for!! Lets get going.. Lets start the whole windows form building in the next post...

Wednesday, June 18, 2008

Let's gets Started!

Hey folks,

I hope you would have installed the VS 2008 express edition!! Woo hoo!! A journey of 1000 miles starts with the single step! So now lets take the next step!! Ok you guys.. If you are Why you should stare at the monitor learning C#.. here is the answer.. C# and VS IDE makes it easier for you to get to the business of writing code and writing it fast. When you are working with C#, the IDE is your best companion.. So what is this IDE? The IDE or the Visual Studio Integrated Development Environment is an important part of working in C#. Its a program that helps you edit your code,manage your files and publish your project..

So, just to draw a button and a checkbox on a form it takes all the code thats been shown above. Adding a few more visual elements to the form could take ten times as much as the shown code!!!!

So what do u get with Visual Studio and C#??

With a language like C# tuned for Windows programming and the Visual Studio IDE, you can focus on what your program is supposed to do immediately!

C# and the Visual Studio IDE makes a lotta things easier!!
Yup!! You do not need to work anything extra.. Heres what all you can do!!!

  • Build an application, FAST: You can leave the mundane coding tasks to IDE and concentrate on what your code should accomplish!
  • Design a great looking User Interface: The FORM designer in the VS IDE is one of the easiest design tools to use out there. You can create stunning User Interfaces using it! And wat more? You can save a lotta time doing like this!
  • Create and interact with Databases: The IDE includes a simple interface for building databases and integrates seamlessly with SQL server Express as well as several popular database systems
  • Focus on solving REAL Problems: The IDE does a lot for you, but you are still in control of what you build with C#. The IDE just lets you focus on your program, your work and your customers.. IDE handles all the grunt work such as
    • Keeping track of all your projects
    • Making it easy to edit your project's code
    • keeping track of your projects graphics,audio,icons and other resources
    • Managing and interacting with databases
All this means you ll have all the time you would've spent doing this routine programming to put into building killer programs.

Tuesday, June 17, 2008

Starting with C# and Visual Studio 2008!

Hey folks..

Guess you wud ve got an idea about what ASP.NET is.. But before we actually jump into the depths of ASP lets see whats C# and .NET is all about and how we use Visual Studio for prgramming Visual C#.. And I would like to make it clear again here that I am addressing the absolute beginners or "geeks under construction" :).. SO this post is for people who wanna learn C# by doing it rather than by reading it!! So, who is this post/blog not for?? If you think that the idea of writing a lotta code makes you bored and a little twitchy and if you are a kick-butt Java/C++ programmer looking for a reference site?? Nopes!! This ain't for u guys.. Its for all learners from scratch.. Who wanna try something different!!


I am gonna write and talk about C# and other things using Visual Studio 2008. So, that means I used C# 3.0 and the .NET Framework 3.5. So, do not worry if you dont have VS 2008! You can download the VS 2008 Express edition for free from the Microsoft website!

Make sure you do a complete installation that should install everything that you need: the IDE, SQL server express edition and the .NET Framework 3.5

Once you ve got it installed, you ll have a new Start Menu option: Microsoft Visual C# 2008 Express Edition. Click on that to bring up the IDE and you're all set :-)

P.S: If you absolutely must use an older verison of VS, C# or .NET framework, then please keep in mind that few codes that are gonna be discussed here might not be compatible with the older version.

Thursday, June 5, 2008


ASP.NET is a platform for developing Web-based applications. It lets you create sophisticated Web applications that can interact with users. For example, ASP.NET applications can use data-entry controls (such as text boxes and buttons) to accept input data from a user; process, retrieve, or update database data; and send the results of these operations back to the user. ASP.NET isn’t the only platform available for creating Web applications. Popular alternatives to ASP.NET include PHP, ColdFusion, and several Java-based tools such as Java Server Pages and Java Servlets. ASP.NET differs from these alternatives in several significant ways.


  1. Windows and IIS dependence
  2. Object orientation
  3. Choice of languages
  4. Visual Studio
I dont think I need to elaborate on each of the features. Its more generic.. I wish to keep my intro post short and lets jump to building ASP.NET apps :-) ..

Till then keep coding and dont forget to freak out. Remember we are always geeks under construction!