Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example:
Last modified Sun, 17th Mar 2012.
You find this example project in your MBS Xojo Plugin download as a Xojo project file within the examples folder: /USB/Serial Devices
Download this example: Serial Devices.zip
Project "Serial Devices.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
update
End EventHandler
End Control
EventHandler Sub Open()
update
End EventHandler
Sub update()
List.DeleteAllRows
dim c as integer = System.SerialPortCount-1
for i as integer = 0 to c
dim s as SerialPort = System.SerialPort(i)
List.AddRow s.Name
List.Cell(List.LastIndex,1)=s.InputDriverName
List.Cell(List.LastIndex,2)=s.OutputDriverName
List.Cell(List.LastIndex,3)=str(s.MaximumSpeed)
List.Cell(List.LastIndex,4)=str(s.RatedSpeed)
next
End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project
Download this example: Serial Devices.zip
The items on this page are in the following plugins: MBS USB Plugin.