ActiveX Control Tutorial - Part 2, Page 5
Now let's test your control!
- Click File, Add Project
- Select 'Standard EXE'
- From the toolbox, add your control to the form
Click on the control and take a peek at the properties window. Do you see the 'AcceptType' and 'ConvertCase' properties?
If you click on any of our custom designed properties, you should be presented with a combo box enabling you to select any of our defined options!
Try changing the options. Does it work?
Note the numbers next to each option. These are automatically added by Visual Basic.
Now try adding a command button and insert code behind it that changes our two properties in code. Notice that just after you type...
... it allows you to select one of our options, making your code much easier to read. Isn't that pleasing!?
Now, using the instructions I gave you last week, set the Standard EXE project as 'startup' then run it, both setting and reading our properties in code.
Did it all work? What happens when you read the properties?
'UserControl1' isn't a very professional name. Why not try changing it to something like 'TextBoxPro' using the techniques we explored last week?