As a complement of solution 1 by Sergey, here is how you can do to link an event-handler to one of your control's events:
- In the designer window of your form, select your LinkLabel control.
- In the 'Properties' Window (CTRL W, P - to show it), click on the 'Events' button.
- In the event list, search for the 'LinkClicked' event, and click on the column next to it to get the focus.
- Type the name of the event-handler: (MyLink_LinkClicked, for example if you have named your control 'MyLink'), and press TAB when you're done. This will create a method with the name you just entered.
- In the code window, you can now do whatever you want to when the LinkLabel has been clicked.
This should be something like:
private void MyLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
byte data = WrapString("01P00104##");
}
Keep in mind the answer given in solution 1, though: prepend/append the chars to the original
send
string, and get the bytes out of it at the end.