Event Handlers
The next task is to put some code behind the navigation buttons. We could just double-click on each button and then add the code to the click event, but why be normal? I would rather we have all our navigation code in one procedure so we can find it easily. In VB 6 we would have done this with a control array, but VB .NET doesn’t support control arrays. What are we to do?
VB .NET does support something called a delegate. If you’re familiar with C or C++, you know that you can create a function pointer and then call the function through the pointer. A function pointer is a variable that contains the address of the entry point of the function. A VB .NET delegate is similar to a function pointer in C++. It is a reference type that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access