c# interface kit

Supporting 2.6 and up
ianth

c# interface kit

Postby ianth » Tue May 10, 2011 3:00 pm

trying to move a vb.net phidget application to c# in linux

started a new console project is visual studio getting

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
}
}
}

in interfacekitfull

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Phidgets; //needed for the interfacekit class and the phidget exception class
using Phidgets.Events; //needed for the event handling classes

namespace InterfaceKit_full
{
public partial class Form1 : Form
{
private InterfaceKit ifKit;
private ErrorEventBox errorBox;
private CheckBox[] digiInArray = new CheckBox[16];
private CheckBox[] digiOutArray = new CheckBox[16];
private CheckBox[] digiOutDispArray = new CheckBox[16];
private TextBox[] sensorInArray = new TextBox[8];

AdvancedSensorForm advSensorForm;


public Form1()
{
InitializeComponent();
errorBox = new ErrorEventBox();
Phidget.enableLogging(Phidget.LogLevel.PHIDGET_LOG_VERBOSE, null);
}

//Initialize the device
private void Form1_Load(object sender, EventArgs e)
{

makeDigiInArray();
makeDigiOutArray();
makeSensorInArray();

label8.Visible = false;
inputTrk.Value = 0;
inputTrk.Enabled = false;
inputTrk.Visible = false;
sensitivityTxt.Text = "";
sensitivityTxt.Visible = false;

ratioChk.Enabled = false;
ratioChk.Checked = false;
ratioChk.Visible = false;
sensorsButton.Visible = false;

try
{
ifKit = new InterfaceKit();

ifKit.Attach += new AttachEventHandler(ifKit_Attach);
ifKit.Detach += new DetachEventHandler(ifKit_Detach);
ifKit.Error += new ErrorEventHandler(ifKit_Error);

ifKit.InputChange += new InputChangeEventHandler(ifKit_InputChange);
ifKit.OutputChange += new OutputChangeEventHandler(ifKit_OutputChange);
ifKit.SensorChange += new SensorChangeEventHandler(ifKit_SensorChange);

//Open the Phidget using the command line arguments
openCmdLine(ifKit);

}
catch (PhidgetException ex)
{
MessageBox.Show(ex.ToString());
}

}

how would I write the form, form_load in the iterfacekit in a console project

Return to “Linux”

Who is online

Users browsing this forum: wuhuilin11 and 1 guest