user3362659
user3362659

Reputation: 1

ProgressBar.Value property not available in Visual Studio 2012 WPF

I’m trying to learn C#. I’m using Visual Studio 2012 Express and WPF in this case.

I’m trying to get the ProgressBar.Value property to become available to be used but it won’t come up even though I’ve got the System.Windows.Controls class enabled and defined.

I can select the ProgressBar.ValueProperty property though. I googled it and didn’t come up with any reasons why it’s missing so far…

Upvotes: 0

Views: 681

Answers (2)

Zougou Lougou
Zougou Lougou

Reputation: 66

Do it on the design view, select the ProgressBar go the proprieties panel (right) and look for Value you can change it as you want,

Therefore if you want to edit it programmatically : Create your instance ( drag and drop from the toolbox or create it using XAML or C# ) and then access it via code :

myProgressBar.Value = 100;

XAML creation code :

 <ProgressBar x:Name="myProgressBar" Value="100" />

Upvotes: 0

Dragomir Răzvan
Dragomir Răzvan

Reputation: 592

I think you made a confusion. You can assign a Value only to instances of ProgressBars, not to the class itself.

ProgressBar myProgressBar = new ProgressBar();
myProgressBar.Value = 30;

It would be a better idea to start learning first OOP (Object oriented programming) instead of C#.

Upvotes: 1

Related Questions