Why should I use objects?
Good question. Imagine this - every time you wanted to use a text box control, you had to add a usercontrol, copy and paste some code, draw a few controls on it, rename them all, test it and then load it onto your form! That would be ridiculous.
Lucky for us there is a way to get around this. We can make objects that contain all their own code and they only let you see a few important bits in the object browser.
This saves ages of time programming, and means that you can easily distribute your control (or whatever object it may be).
Although Visual Basic is not a completely object orientated language (that would have to include geeky things like inheritance and other complicated stuff) it does allow us to use objects in our code.
Now that you know why you should use them, and you注释:ve seen some examples of objects in VB (the Textbox and RichTextBox controls in case you had already forgotten), you may now be wanting to build your own (or you might not be wanting to build your own, but that注释:s what we注释:re going to do next so ha!)
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073