1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| if (usbDevices.Count != 0) // usbDevices.Count est égal a 0 !
{
try
{
wgssSTU.IErrorCode ec = m_tablet.usbConnect(usbDevice, true);
if (ec.value == 0)
{
m_capability = m_tablet.getCapability();
m_information = m_tablet.getInformation();
}
else
{
throw new Exception(ec.message);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
this.Close();
}
}
else
this.Close();
Size clientSize = new Size((int)(m_capability.tabletMaxX / 2540F * 96F), (int)(m_capability.tabletMaxY / 2540F * 96F)); //ici m_capability est null si aucune tablette est connectée !
this.ClientSize = clientSize;
this.ResumeLayout(); |
Partager