VBGood网站全文搜索 Google

首页 - 经验之谈 - 初识object-如何使用objects?
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:8876, 日期:2001-05-08
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!)