This will drop a "Serial1" into the shelf at the bottom of the Window's layout and the new control will be available to use from code in Window1. Otherwise, if you don't need to make a subclass of Serial and just want to use its methods and events from your Window1, then delete "serial1" from the left navigator, select your "Window1" again so that you see the Window1 layout editor and drag a Serial control from the right-hand library into the Window's layout. This will add something like "Serial11" as a control on your Window1 which you can use by changing your existing code in the Window1.Open event to: Serial11.Baud = Serial.Baud9600 ![]() To keep your Serial1 sub-class (might be an idea to rename it though) just drag it from the Navigator where you see it on the left onto "Window1". ![]() It looks like you've added your new Serial control to the project (effectively as a new class) rather than as a new control on your window.ĭo you want to create a Serial subclass, or just use a new Serial control from your Window?
0 Comments
Leave a Reply. |