Results 1 to 6 of 6

Thread: [VB6] - Usercontrol PropertySheet Enumeration Enhancement

Threaded View

  1. #1

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Thumbs up [VB6] - Usercontrol PropertySheet Enumeration Enhancement

    I was looking at a post on vbAccelerator on using a DLL and TLBs to customize the dropdown listing shown on IDE's property sheet for usercontrol properties. The project showed how a typical dropdown might look like the following and can be modified at will
    Code:
    Default Behavior        Modified Behavior
    0 - vbLeftJustified      0 - Left Aligned
    1 - vbRightJustified     1 - Right Aligned
    2 - vbCenter             2 - Centered
    I really liked the idea and thought about a different way of accomplishing the same thing without any ActiveX DLL or TLBs. The attached is my version of vbAccelerator's project.

    Note that the methods used allow on-demand, dynamic, "enumerations" that can even be strings vs numerical enumerations. These enumerations are not true enumerations but rather an array of strings that act like enumerations within the property sheet, providing a dropdown list to select from.

    For example. Let's say your user control needs to show a listing of available textboxes on the form. In the past, we would have to offer a property page that basically added all the textbox names to a listbox so the user can select one from it. Now, we can provide that list in a dropdown box that will be displayed on the property sheet and no need for a property page just for that purpose.

    Anyway, I thought vbAccelerator project was interesting enough to try and replicate it a diffferent way. This is the different way.
    Warning. Pretty advanced stuff for such little gain, IMO, but it does present a more "professional" and personal touch to how enumerations are offered to users in design time.
    Name:  screenshot.JPG
Views: 1860
Size:  20.6 KB
    Attached Files Attached Files
    Last edited by LaVolpe; Dec 18th, 2008 at 10:19 AM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width