oillasas.blogg.se

Xojo examples
Xojo examples













Just about anything will do but lets start simpleĭrag a CANVAS control out onto the window In that event you can change the color of “something” or set a status that can be used to control the color of somethingĢ) what kind of indicator should I use for this status?

#Xojo examples code

In the code for the CONNECTED event you may get a response (this is the part that I cant tell / test since I dont have one) what kind of indicator should I use for this status?.control teh indicator on the main window to show the CONNECT status?.I have added a CONNECT handler to teh TCPSocket, but heres where I get lost… I would like to put in the window some sort of indicator that I can, say change the color from RED to GREEN based on the connect status. In that action I have the following: TCPSocket1.Connect() So I have created a button on Window 1 and added an action. If I right click on it, and select INSPECT I get a panel on the right side where in the BEHAVIOR section I can put the IP address and PORT as opposed to the lines in the button action you have listed above -Is this ok? I dragged the TCPSocket into the workspace and its sitting at teh bottom of the screen. I have teh device configured with an IP address of 10.10.5.188 and it responds on port 10000Īccording to the manufacturer its pretty straightforward to connect to these servers and pointed me to this: Here is the device I am looking to connect to:

xojo examples

What specific code should go in these will depend entirely on how the device / computer / etc you’re trying to connect TO expects to communicate

xojo examples

Responding to any data or other errors would be done by adding the EVENT HANDLERS to TCPSocket1

xojo examples

  • set the address that it is going to try to connect TO // TCPSocket1.Address = “192.168.1.234”.
  • set the port it is going to try to connect TO // TCPSocket1.Port = 10000.
  • Now, believe it or not … you are mostly done although you wont see anything really happenīut when you click that button the socket instance on the layout will In the following lines replace MYSOCK with TCPSocket1 since that is the name of the instance on your layout TCPSocket1.Port = 10000 This line would have created a new socket but you already have one on the layout If you have an instance that you already dragged onto the layout you do not need the first line // Dim mysock As New TCPSocket // <<< not needed if you dragged an instance onto the window layout I guess the question is WHEN do you want that socket to try & connect to something ?Īdd a Generic Button and add the ACTION event to that button (drag it out from the right hand library and the nwhen you have it on the layout right click and add event handler)













    Xojo examples