int RTPower = Int32.Parse(powerTextBox.Text);
or for decimal values
decimal RTPower = Decimal.Parse(powerTextBox.Text);
You need to convert the value from a string to an int.
Also, I assume you are new to c# – my advice would be to avoid using var and explicitly declare your variables. It will make things clear and easier for you to learn and understand.
Related Contents:
- VS2010 does not show unhandled exception message in a WinForms Application on a 64-bit version of Windows
- The type or namespace name could not be found [duplicate]
- Filtering DataGridView without changing datasource
- What does question mark and dot operator ?. mean in C# 6.0?
- What is the difference between the | and || or operators?
- Can’t operator == be applied to generic types in C#?
- Unable to load DLL ‘SQLite.Interop.dll’
- Interop type cannot be embedded
- Copy file(s) from one project to another using post build event…VS2010
- How do I overload the square-bracket operator in C#?
- two different DLL with same namespace
- Type or namespace name does not exist [closed]
- How do I create/edit a Manifest file?
- Why we have both jagged array and multidimensional array?
- Using multiple versions of the same DLL
- How to call a C# library from Native C++ (using C++\CLI and IJW)
- How do I fix a .NET windows application crashing at startup with Exception code: 0xE0434352?
- How do I connect to an MDF database file?
- Dependent DLL is not getting copied to the build output folder in Visual Studio
- Is there a C# case insensitive equals operator?
- What is the “??” operator for? [duplicate]
- Correct way communicate WSSE Usernametoken for SOAP webservice
- What does |= (single pipe equal) and &=(single ampersand equal) mean
- Error deploying ClickOnce application – Reference in the manifest does not match the identity of the downloaded assembly
- pinvokestackimbalance — how can I fix this or turn it off?
- Where can I find System.Web.Helpers, System.Web.WebPages, and System.Web.Razor?
- MVCBuildViews not working correctly
- In C# Winforms is there a way to put dotted border around all controls and show grip points upon selection of specific controls at runtime?
- How do I generate a constructor from class fields using Visual Studio (and/or ReSharper)?
- How to suppress a StyleCop warning?
- How to put a UserControl into Visual Studio toolBox
- How do I debug Windows services in Visual Studio?
- Visual Studio designer in x64 doesn’t work
- How can I calculate divide and modulo for integers in C#?
- C# hide and unhide comments
- How to compare Lists in Unit Testing
- visual studio 2010 conditional references
- DateTime.AddDays() not working as expected
- Setting the datasource for a Local Report – .NET & Report Viewer
- Visual Studio 2010: How to enforce build order of projects in a solution?
- Visual Studio Installer > How To Launch App at End of Installer
- Visual Studio C# IntelliSense not automatically displaying
- TreeView with columns
- I’m getting the “missing a using directive or assembly reference” and no clue what’s going wrong
- Why does this Parallel.ForEach code freeze the program up?
- Is there a format code shortcut for Visual Studio?
- Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away
- Getter and Setter declaration in .NET [duplicate]
- Why does TestInitialize get fired for every test in my Visual Studio unit tests?
- How can I make implementation of an interface produce an auto property instead of NotImplementedException?