Visual C# temp sensor reading to textbox
Navigates to RoboticsConnection.com Home RoboticsConnection.com HomePage
RoboticsConnection User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Visual C# temp sensor reading to textbox Expand / Collapse
Author
Message
Posted Tuesday, April 15, 2008 2:47 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Tuesday, April 15, 2008 4:33 PM
Posts: 1, Visits: 5
Hello, I am writing a C# Windows Application, not a console application. I need to know how to add the temperature sensor output to a textbox located within the application:

static void tempSensor_TemperatureChanged(SerializerComponent sender)
{
textbox1.Text = "Temp: {0}" + tempSensor.Temperature;
}

Because it is static, I can't seem to figure out how to access the textbox1 to update it with the correct information. Can anyone please help me figure this out. I am fairly new to C# so any help will do. I can show more of the code if needed. Thanks.
Post #345
Posted Wednesday, April 16, 2008 7:07 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, December 01, 2008 6:34 PM
Posts: 299, Visits: 426
You can use:

textbox1.Text = tempSensor.Temperature.ToString();

Best Regards!

Jason Summerour
President,
Summerour Robotics Corporation
Microsoft MVP
www.roboticsconnection.com

Post #351
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: jsummerour, ringo

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 2:44pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.140. 9 queries. Compression Disabled.