473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Can't add a reference to namespace System.Windows.Controls

I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. I see a
System.Windows.Forms, but not a System.Windows.Controls.

Can someone let me know how I go about getting it in the list of
available references?
Thanks

Jody
Jun 27 '08 #1
17 20292
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jo******@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. I see a
System.Windows.Forms, but not a System.Windows.Controls.

Can someone let me know how I go about getting it in the list of
available references?
Do you have .NET 3.0 installed and the appropriate SDK?
System.Windows.Controls is part of WPF.

Pete
Jun 27 '08 #2
On Jun 22, 1:50*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jodyb...@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. *I see a
System.Windows.Forms, but not a System.Windows.Controls.
Can someone let me know how I go about getting it in the list of
available references?

Do you have .NET 3.0 installed and the appropriate SDK? *
System.Windows.Controls is part of WPF.

Pete
I'm kind of new at this stuff, so i hope i'm giving you the info you
requested. I have .NET 3.5 Installed. I installed a Windows SDK, but
i'm not sure if this is the SDK you are refering to.

Jody
Jun 27 '08 #3
On Jun 22, 1:50*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jodyb...@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. *I see a
System.Windows.Forms, but not a System.Windows.Controls.
Can someone let me know how I go about getting it in the list of
available references?

Do you have .NET 3.0 installed and the appropriate SDK? *
System.Windows.Controls is part of WPF.

Pete
I hope this isn't getting double posted (I thought i posted once, but
it didn't seem to show up).
I have .NET 3.5 installed, the only SDK's that I know that I have
installed are DirectX and Windows.
Is there a different SDK that I need?

Thanks,

Jody
Jun 27 '08 #4
On Jun 22, 1:50*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jodyb...@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. *I see a
System.Windows.Forms, but not a System.Windows.Controls.
Can someone let me know how I go about getting it in the list of
available references?

Do you have .NET 3.0 installed and the appropriate SDK? *
System.Windows.Controls is part of WPF.

Pete
I have .NET 3.5 installed. Which SDK do I need?

Thanks,

Jody
Jun 27 '08 #5
On Jun 22, 2:06*pm, Blau <jodyb...@gmail.comwrote:
On Jun 22, 1:50*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 12:46:17 -0700, Blau <jodyb...@gmail.comwrote:
I'm trying to use the System.Windows.Controls namespace, but when I
try to add a reference to it I don't see it in the list. *I see a
System.Windows.Forms, but not a System.Windows.Controls.
Can someone let me know how I go about getting it in the list of
available references?
Do you have .NET 3.0 installed and the appropriate SDK? *
System.Windows.Controls is part of WPF.
Pete

I hope this isn't getting double posted (I thought i posted once, but
it didn't seem to show up).
I have .NET 3.5 installed, the only SDK's that I know that I have
installed are DirectX and Windows.
Is there a different SDK that I need?

Thanks,

Jody
ok, i've done some more research based upon the questions you asked.
MSDN is telling me that I need Microsoft .NET Framework and the
Windows Software Development Kit (SDK) installed. I believe that I
have both installed.

So how do I gain access to the WPF, in particular the
System.Windows.Controls namespace within Vistual Studio 2005?

Thanks,

Jody
Jun 27 '08 #6
On Sun, 22 Jun 2008 13:28:41 -0700, Blau <jo******@gmail.comwrote:
ok, i've done some more research based upon the questions you asked.
MSDN is telling me that I need Microsoft .NET Framework and the
Windows Software Development Kit (SDK) installed. I believe that I
have both installed.
But which versions?

You can't use just any random .NET and SDK. You have to have the ones
that include WPF, which are those that support .NET 3.0 and later.
So how do I gain access to the WPF, in particular the
System.Windows.Controls namespace within Vistual Studio 2005?
In VS2005, you'll need to install the SDK separately (VS2008 includes it,
but the SDK that comes with VS2005 doesn't include .NET 3.0 support, since
it predates that version of .NET). You can find the latest SDK that
supports WPF here:
http://www.microsoft.com/downloads/d...6-711ebe331cdc

Pete
Jun 27 '08 #7
On Jun 22, 3:13*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 22 Jun 2008 13:28:41 -0700, Blau <jodyb...@gmail.comwrote:
ok, i've done some more research based upon the questions you asked.
MSDN is telling me that I need Microsoft .NET Framework and the
Windows Software Development Kit (SDK) installed. *I believe that I
have both installed.

But which versions?

You can't use just any random .NET and SDK. *You have to have the ones *
that include WPF, which are those that support .NET 3.0 and later.
So how do I gain access to the WPF, in particular the
System.Windows.Controls namespace within Vistual Studio 2005?

In VS2005, you'll need to install the SDK separately (VS2008 includes it,*
but the SDK that comes with VS2005 doesn't include .NET 3.0 support, since *
it predates that version of .NET). *You can find the latest SDK that *
supports WPF here:http://www.microsoft.com/downloads/d...D=e6e1c3df-a74...

Pete
So I have .NET 3.5 installed. I also have the version of Windows SDK
that you linked installed.
So now that I have the .NET and Windows SDK installed, how do I make
Visual Studio 2005 aware of them? I still can't seem to get the
System.Windows.Controls namespace to appear when I try to add a
reference.

Thanks,

Jody
Jun 27 '08 #8
On Sun, 22 Jun 2008 14:25:26 -0700, Blau <jo******@gmail.comwrote:
So I have .NET 3.5 installed. I also have the version of Windows SDK
that you linked installed.
So now that I have the .NET and Windows SDK installed, how do I make
Visual Studio 2005 aware of them? I still can't seem to get the
System.Windows.Controls namespace to appear when I try to add a
reference.
Okay, at this point we have -- assuming you are describing your situation
correctly -- determined that you have the necessary prerequisites.

So the next step is for you to be very clear about what it is exactly
you're doing, and what doesn't work about it. Describe the exact steps
you're taking, including the precise names of menu commands you're using,
etc. Tell us what you see and why that's different from what you expected
to see.

Pete
Jun 27 '08 #9
Blau <jo******@gmail.comwrote:
I have .NET 3.5 installed. Which SDK do I need?
If you've got .NET 3.5 installed, that should be fine. Chances are you
just don't have the right project references. When you created the
project, what kind of project did you choose?

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #10
Jon Skeet [C# MVP] <sk***@pobox.comwrote:
Blau <jo******@gmail.comwrote:
I have .NET 3.5 installed. Which SDK do I need?

If you've got .NET 3.5 installed, that should be fine. Chances are you
just don't have the right project references. When you created the
project, what kind of project did you choose?
Apologies - I had assumed that if you'd installed .NET 3.5, you'd also
got Visual Studio 2008.

Is there any reason why you have to use VS 2005? It's all going to be
*much* easier with 2008...

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #11
On Jun 22, 3:31*pm, Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Blau <jodyb...@gmail.comwrote:
I have .NET 3.5 installed. *Which SDK do I need?
If you've got .NET 3.5 installed, that should be fine. Chances are you
just don't have the right project references. When you created the
project, what kind of project did you choose?

Apologies - I had assumed that if you'd installed .NET 3.5, you'd also
got Visual Studio 2008.

Is there any reason why you have to use VS 2005? It's all going to be
*much* easier with 2008...

--
Jon Skeet - <sk...@pobox.com>
Web site:http://www.pobox.com/~skeet*
Blog:http://www.msmvps.com/jon_skeet
C# in Depth:http://csharpindepth.com
Ya, i'm trying to use the XNA stuff from microsoft, and XNA 2.0
doesn't support 2008; So that is why i've been trying to figure it out
for 2005

Thanks,

Jody
Jun 27 '08 #12
On Jun 22, 3:36*pm, Blau <jodyb...@gmail.comwrote:
On Jun 22, 3:31*pm, Jon Skeet [C# MVP] <sk...@pobox.comwrote:


Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Blau <jodyb...@gmail.comwrote:
I have .NET 3.5 installed. *Which SDK do I need?
If you've got .NET 3.5 installed, that should be fine. Chances are you
just don't have the right project references. When you created the
project, what kind of project did you choose?
Apologies - I had assumed that if you'd installed .NET 3.5, you'd also
got Visual Studio 2008.
Is there any reason why you have to use VS 2005? It's all going to be
*much* easier with 2008...
--
Jon Skeet - <sk...@pobox.com>
Web site:http://www.pobox.com/~skeet*
Blog:http://www.msmvps.com/jon_skeet
C# in Depth:http://csharpindepth.com

Ya, i'm trying to use the XNA stuff from microsoft, and XNA 2.0
doesn't support 2008; So that is why i've been trying to figure it out
for 2005

Thanks,

Jody- Hide quoted text -

- Show quoted text -
So when I create a project, I create a windows game 2.0 project using
XNA 2.0 in Visual Studio 2005.
I'm trying to learn how to create buttons and other controls within
the game application. One reference book that I have wants me to
create a "canvas" on which to draw my controls; but I noticed a
reference to a Canvas on MSDN that is contained within
System.Windows.Controls; So I thought I would see if it was possible
for me to use the Canvas in that Namespace, rather than create my own.

So i rightclick on the project references and go to add a reference.
It brings up a list of .net references, but they are all 2.0
references and so the namespace I want isn't there. How do I make
visual Studio 2005 look for .net 3.0 or 3.5 references?

thanks,

Jody
Jun 27 '08 #13
On Sun, 22 Jun 2008 14:43:57 -0700, Blau <jo******@gmail.comwrote:
[...]
I'm trying to learn how to create buttons and other controls within
the game application. One reference book that I have wants me to
create a "canvas" on which to draw my controls; but I noticed a
reference to a Canvas on MSDN that is contained within
System.Windows.Controls; So I thought I would see if it was possible
for me to use the Canvas in that Namespace, rather than create my own.
You can only use the Canvas class from WPF if that's the exact class that
the book had in mind. Otherwise, the fact that the book is using the name
"Canvas" for the class is an unfortunate coincidence, and has nothing to
do with using the WPF class.

That said...
So i rightclick on the project references and go to add a reference.
It brings up a list of .net references, but they are all 2.0
references and so the namespace I want isn't there.
What do you mean "they are all 2.0 references"? Even if you don't have
the .NET 3.0 SDK installed, you should see libraries other than 2.0. But
regardless, it's not the version of the reference that you really should
care about.

As the MSDN docs say, the Canvas class (and other WPF classes) are found
in the PresentationFramework library. So as long as you find that library
in the "Add Reference" dialog, that should be fine (my guess is that it'll
show "3.0.0.0" as the version, but even if one day that changes, the
important part will be using the correct library).
How do I make
visual Studio 2005 look for .net 3.0 or 3.5 references?
If you have the SDK correctly installed, there's nothing else for you to
do. If you don't, then you need to install the SDK correctly before the
PresentationFramework library will appear in the "Add Reference" dialog.

Pete
Jun 27 '08 #14
Blau <jo******@gmail.comwrote:
So when I create a project, I create a windows game 2.0 project using
XNA 2.0 in Visual Studio 2005.
I'm trying to learn how to create buttons and other controls within
the game application. One reference book that I have wants me to
create a "canvas" on which to draw my controls; but I noticed a
reference to a Canvas on MSDN that is contained within
System.Windows.Controls; So I thought I would see if it was possible
for me to use the Canvas in that Namespace, rather than create my own.
Not a good idea. Trying to use one GUI framework within a completely
different one is rarely going to work. I suggest you stick to the XNA
classes.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #15
On Sun, 22 Jun 2008 15:00:48 -0700, Jon Skeet [C# MVP] <sk***@pobox.com>
wrote:
Blau <jo******@gmail.comwrote:
>So when I create a project, I create a windows game 2.0 project using
XNA 2.0 in Visual Studio 2005.
I'm trying to learn how to create buttons and other controls within
the game application. One reference book that I have wants me to
create a "canvas" on which to draw my controls; but I noticed a
reference to a Canvas on MSDN that is contained within
System.Windows.Controls; So I thought I would see if it was possible
for me to use the Canvas in that Namespace, rather than create my own.

Not a good idea. Trying to use one GUI framework within a completely
different one is rarely going to work. I suggest you stick to the XNA
classes.
All due respect, IMHO that all depends on what the book's intent is.

I personally skeptical that the "canvas" class mentioned in the book is in
fact the WPF Canvas class. But, if it is, presumably the book has a
specific approach to using it that allows it to co-exist with the XNA
classes.

And more generally, as long as one follows specific rules, there's no
reason you can't mix different GUI classes. The biggest issue I see would
be making sure you don't try to share the same thread between multiple
frameworks. Taking the System.Windows.Forms and System.Windows.Controls
namespaces as an example, as long as each runs its own message dispatcher
on its own thread, the two should be able to co-exist. I presume a
similar requirement would exist trying to use XNA and WPF at the same time.

From a maintenance point of view, this approach seems, umm...non-optimal.
:) But the phrase "rarely going to work" seems correct only if you assume
that rarely would a person trying to do so understand how to do it
correctly. If that's the criteria, I think there's lots in .NET that is
"rarely going to work", given how often we see people who don't understand
how to use the various parts correctly. Our job is to help them
understand, so that these rare moments happen more often. :)

Of course, if my suspicion is correct and the book's "canvas" class has
nothing to do with WPF, then the OP isn't going to be successful with this
approach. But the reason would be that it's just the wrong "canvas"
class, not because he's trying to mix XNA and WPF.

Pete
Jun 27 '08 #16
"Blau" wrote:
So I have .NET 3.5 installed. I also have the version of Windows SDK
that you linked installed.
So now that I have the .NET and Windows SDK installed, how do I make
Visual Studio 2005 aware of them? I still can't seem to get the
System.Windows.Controls namespace to appear when I try to add a
reference.
I realize this conversation has already taken a different direction, but for
the benefit of the people who really do need to get WPF working with VS.NET
2005, two things: first, AFAIK you can't use .NET 3.5. .NET 3.0 is possible
though, by installing the Visual Studio 2005 extensions for .NET Framework
3.0 at
http://www.microsoft.com/downloads/d...displaylang=en
.. This gets you the new file and project types in the Add New... menus and
the WPF form designer.

Hope this is of assistance to someone. :)
Jun 27 '08 #17
On Sun, 22 Jun 2008 22:27:02 -0700, Rytmis
<Ry****@discussions.microsoft.comwrote:
I realize this conversation has already taken a different direction, but
for
the benefit of the people who really do need to get WPF working with
VS.NET
2005, two things: first, AFAIK you can't use .NET 3.5.
The link I provided claims support for .NET 3.5 and compatibility with VS
2005. That seems to contradict your statement.
.NET 3.0 is possible
though, by installing the Visual Studio 2005 extensions for .NET
Framework
3.0 at
http://www.microsoft.com/downloads/d...displaylang=en
Note that that link is for a CTP. That is, a "Community Technology
Preview". From that page:

These tools are provided as an early preview of
technology being considered for the Orcas release
of Visual Studio. These tools are not supported by
Microsoft but provided as is to enable early adoption
of the .NET Framework 3.0 platform. Users will be
expected to upgrade to the Visual Studio Orcas
release when that becomes commercially available.

Why Microsoft continues to make that download available, I can't say. But
it's not something I'd use today.

Pete
Jun 27 '08 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Chris | last post by:
Hi all I would appreciate some help with a program I have written from the Sams teach your self c# book. I have checked my code several times and even rewritten it. when I compile (Sharp...
3
by: Poewood | last post by:
Okay here are four classes for a pocket pc program: Input, fpositional, ComboBoxArray and TextBoxArray. The "input" class is the form. I use the fpositional class to handle most of the functions...
6
by: Henry | last post by:
I was trying to derive a class from System.Windows.Forms.ComboBox. My goal was to create a class that loaded its own data. I did not want to create too many objects, so I tried to share a Database...
3
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has...
4
by: DotNetJunkies User | last post by:
I have created a User Control (a Pareto Chart) using C#. It works great in .Net Windows Apps, but I also need to use it in a Web Application (to view in IE). Everything I read on this seems to be...
10
by: Miro | last post by:
I wanted certain text boxes ( only certain ones ) to always be Trim'd so that spaces are not in the begining, nor the end of the text entered. I created my own "Handle ?" - i hope thats the...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
5
by: lukasmazur | last post by:
Hi I have a problem with using listBox1. I have a two forms form1 and form2. In form1 are controls listBox1, textBox1 and button witch creating object of class Form2. In class Form2 I create a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.