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.

second

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!!!

fourth

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:

sixth

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.

seventh

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!!

36 comments:

--xh-- said...

good going.. :)

Anonymous said...

To the owner of this blog, how far youve come?You were a great blogger.

Anonymous said...

Considering the fact that it could be more accurate in giving informations.

Anonymous said...

viagra rx female use of viagra which is better cialis or viagra which is better cialis or viagra viva viagra song new viagra viagra for sale without a prescription instructions for viagra use buy sublingual viagra online can viagra causes legs to ache can women take viagra levitra vs viagra soma and viagra prescriptions free viagra viagra pill

Anonymous said...

Best Online Casinos tyuueooru
Free Casino Bonus
In fact, there is no risk at all.
[url=http://www.nhgaa.org/]Best Online Casino[/url]
So, it is vital to be able to find a right online casino website for you if you don't want your online gambling experience to be annoying and regretting.
http://www.nhgaa.org/ - Free Online Casino
For this purpose, you may require checking out the lists of good gambling websites that are offered on various sites in the form of ratings, reviews, etc.

Anonymous said...

It isn't hard at all to start making money online in the undercover world of [URL=http://www.www.blackhatmoneymaker.com]blackhat money making[/URL], Don’t feel silly if you don't know what blackhat is. Blackhat marketing uses little-known or misunderstood ways to produce an income online.

Anonymous said...

hi every person,

I identified geekunderconstruction.blogspot.com after previous months and I'm very excited much to commence participating. I are basically lurking for the last month but figured I would be joining and sign up.

I am from Spain so please forgave my speaking english[url=http://submityournewsck.info/forum].[/url][url=http://mothehottesttopics.info/forum].[/url][url=http://grcoolnewideas.info/forum].[/url]

Anonymous said...

It is my first post here, so I would like to say hallo to all of you! It is really comfort to join your community!

Anonymous said...

this is very good for you, ybg :)

Anonymous said...

torebki skórzane
to torebki , torebki damskie , torebki batycki . torebki skórzane damskie , kazar sklep internetowy ?

Anonymous said...

david jones
to david jones , david jones , . torebki david jones , ?

Anonymous said...

projektowanie wnetrz warszawa
to projektowanie wnetrz warszawa , projektant wnetrz , . projektowanie wnetrz , ?

Anonymous said...

Поздравления с днем святого Валентина sms
[url=http://idimka.ru/pozdravlenie_%D1%81_day_%D1%81%D0%B2%D1%8F%D1%82%D0%BE%D0%B3%D0%BE_valentina]Поздравления с днем святого Валентина[/url]
Поздравления с днем святого Валентина

Anonymous said...

cheap xanax what is xanax 0.5mg - xanax drug for sleep

Anonymous said...

generic viagra viagra 25mg - order viagra professional

Anonymous said...

buy soma online do soma pills expire - soma 180 pills

Anonymous said...

soma price soma cost street - soma san diego silversun pickups

Anonymous said...

buy soma online soma muscle relaxer medication - do drug test test soma

Anonymous said...

buy soma soma 250 drug interactions - dosage for soma muscle relaxant

Anonymous said...

soma buy ver argento soma online - valium and soma drug interactions

Anonymous said...

buy cialis cialis online to usa - reviews viagra cialis levitra

Anonymous said...

buy cialis online generic cialis walmart - buy cialis online usa

Anonymous said...

tramadol 50mg tramadol 50 mg hcl narcotic - buy tramadol online usa

Anonymous said...

buy xanax online no prescription overnight street value for xanax 1mg - xanax generic no prescription

Anonymous said...

xanax drug pictures of xanax generic pills - xanax withdrawal when does it start

Anonymous said...

generic xanax xanax bars definition - xanax used opiate withdrawal

Anonymous said...

xanax online xanax 1 mg apteka - xanax effects

Anonymous said...

buy cialis online order cialis in usa - xlpharmacy generic cialis

Anonymous said...

order cialis online no prescription cialis coupon 30 tablets free - buy cialis online in australia

Anonymous said...

cialis online cialis daily free sample - cialis how it works

Anonymous said...

learn how to buy tramdadol tramadol hcl 25mg dogs - get over tramadol addiction

Anonymous said...

http://buytramadolonlinecool.com/#73892 tramadol withdrawal can't sleep - tramadol er 100mg side effects

Anonymous said...

http://landvoicelearning.com/#57594 tramadol headache - buy tramadol online prescription

Anonymous said...

buy tramadol online buy tramadol online australia - buy tramadol without prescriptions

Anonymous said...

klonopin medication klonopin and alcohol fun - klonopin online overnight

Anonymous said...

klonopin cost klonopin .125 wafers - hydrocodone klonopin erowid