Windows Form Application | LabJack

Windows Form Application

2 posts / 0 new
Last post
Usman Sidiqi
Usman Sidiqi's picture
Windows Form Application

I am trying to use the Single AIN code within a windows form application in C#. I got the SingleAIN code from the examples and then I made my own Windows Form App. I basically copied the performActions and showErrorMessage functions and replaced Console.WriteLine and Console.Out.WriteLine with textBox1.AppendText. I am getting errors around the performAction part. I attached the .cs file.

File Attachment: 
LabJack Support
LabJack Support's picture
The main issue appears to be

The main issue appears to be that you define performActions within your button click function. With this, performActions is not defined outside of the button click function, so you should move the performActions function definition outside of the button click function. I would also recommend you define [STAThread] above your main function.

Attached below is a similar project to what you are doing if it is at all helpful.

File Attachment: