# .NET and More > Silverlight >  Adding controls

## ngreenwood6

I have just started messing with silverlight and am confused about one thing. Can you not drag and drop the silverlight controls to the form? I have created wpf browser applications which seem to be very similar but I am unable to drag and drop the controls. I can edit the XAML code and add a button but with wpf browser applications you can drag and drop and then edit the XAML code. Can someone clear this up for me? If you can, please explain how because i also do not get the properties list on the right when I add my own XAML code to the project but the button is showing up.

----------


## DeanMc

I imagine your using a vs 2008 variant of some description. From what I can see the designer in any 2008 product does not have support for dragging and droping. One the one hand this is an annoyance for obvious reasons but on the other hand it forces you to become comfortable with Xaml.

You have two options if you what drag and drop...

1: Download VS2010 here and use that while its in beta. (I use it and it seems to be fine).

2: Purchase Expression Blend 3 here and use that (Amazing product but costly).

Personally though I would recommend that you stay with vs 2008 and type the Xaml as it will help in the long run since you will know how to finely tune your Xaml as your applications get larger.

----------


## peteshir

You can't even double click on a control to add "code Behind" I have not figured out how to do that. Do you know?

----------


## peteshir

I found you have to type "Click" and then intellisense will come up and you select "Add New Event Handler". Then if you right clicl on "Click" it will allow you to go right to the handler.

----------


## DeanMc

Yes you are correct. When in the code window there are also two dropdown boxes above it. One for the object and the other for its events you can create an event handler from there.

----------


## MattP

Microsoft correctly decided that their design surface in Visual Studio 2008 was crap and made it read only.  They'll be rectifying this situation in Visual Studio 2010 and it seems to work just fine there as DeanMc has stated.

Since it hasn't been stated in the thread you can drag controls directly into your Xaml which can be very helpful in getting the base markup started and automatically adds missing xmlns entries.  (It adds them to the beginning and doesn't put a line break in but that's easily fixed.)

----------

