开发者_开发知识库
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this questionI am using VB 6, but I am new to the language.
In my MDI form, I want to add some additional controls, but in VB 6 it has common controls only.
How can I get additional and effective controls to use in my application?
What type of controls are you looking for?
There are some additional Common Control libraries available that are not added by default to a new project. As the answer provided by codethis suggests, go to the "Projects" menu in the VB 6 IDE and select "Components". Then, scroll down nearly to the bottom of the list, and select "Microsoft Windows Common Controls", "Microsoft Windows Common Controls-2", and "Microsoft Windows Common Controls-3". I recommend you use the newest versions that are available (chances are, that's version 6.0, rather than version 5.0) unless you have a specific reason not to do so. The first will add the TreeView, ListView, a toolbar, ImageList, ImageComboBox, a slider, ImageList, and a couple of other controls. The latter two will score you a Date and Time Picker, a flat scrollbar, a numeric up-down textbox, a IE-style Rebar/Coolbar, and a few other items.
You can add other control components from that dialog as well, depending on what applications you have installed on your computer. Adobe Reader, for example, provides an ActiveX DLL that you can use in your VB applications to display PDFs. But be careful using some of these, because they introduce additional dependencies into your application, either requiring that your users have the appropriate applications installed on their computers as well or that you include the necessary DLLs/OCXs with your application's installer.
Also, the VB Accelerator site is worth a careful look. There's tons of stuff available, from full-fledged controls to code libraries and how-to articles. If you're trying to spiff up your VB 6 application, I truly haven't found a better place to find what you'll need. Plus, all of the code and controls provided are open source, so you can feel free to make modifications and changes as needed. This is a really big benefit because most of the VB 6 controls that you'll come across are no longer supported by their manufacturer, so if you find a bug or an incompatibility, well, you're pretty much out of luck. With these controls, you'll be able to find and fix it yourself.
Karl Peterson's infamous Classic VB website is also helpful, providing a handful of controls and tons of useful code samples.
akTools also provides some free VB 6 controls, although I haven't tried any of these myself so I can't vouch for them personally.
Finally, if you're really enterprising, you can create your own controls. Follow some of the examples you find on either of the two above websites, or create a new ActiveX Control project in VB 6 and design away. If you find yourself limited by what you can do in VB 6 (but can't move up to another language for whatever reason), you can also look into using VB.NET controls in a VB 6 project. There are some limitations, but the Interop Forms Toolkit as well as this article on CodeProject can help get you started.
EDIT: I just realized your question asks specifically about controls for an MDIForm. Unfortunately, in VB6, you cannot place any controls directly on an MDI parent form (MDIForm
) that do not have an Align
property. An MDI parent is intended only as a container for MDI child forms (regular forms that have their MDIChild
property set to "True") and perhaps a menu bar, toolbar, and/or status bar.
However, there is a workaround. You can add a PictureBox
control, whose BorderStyle
property is set to "0" and whose Align
property is set to whichever side of the MDI parent that you want it to appear on, and then drop whatever other controls you like onto that PictureBox
control.
What IDE are you using to develop?
Is there a Projects > Components
menu in your IDE? If so, you should be able to select libraries of controls there.
精彩评论