Accessing a text box in WPF

DeepSpace

New member
Joined
Feb 5, 2025
Messages
1
Programming Experience
Beginner
Hey All,

Being new to the C#, Visual Studio/WPF environment, I'm struggling to find the right resources to get answers to some basic questions. So I appreciate any help with answers or references to other resources.
I'm creating a test application using WPF and I have a textbox that I would like to use for displaying data.
The application will query a piece of test equipment for voltage, current an power, then I would like to display that data in the textbox.
VS has created the basic xaml for the window form and basic C# code, but how do I actually post data in that window?
How do I establish a reference to that textbox (named PowerValues) so that I can write the power data to that textbox?

Sorry for this basic question, but hey, ya gotta start somewhere.
Thank you in advance for any help.

Here is the code created by VS:

using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CT_3_USB_Desktop
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
 
Back
Top Bottom