Results 1 to 40 of 2424

Thread: CommonControls (Replacement of the MS common controls)

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012

    CommonControls (Replacement of the MS common controls)

    This project is intended to replace the MS common controls for VB6.

    The "MSCOMCTL.OCX" (respectively "COMCTL32.OCX") can be replaced completly.
    The "MSCOMCT2.OCX" (respectively "COMCT232.OCX") can be replaced completly.
    The "RICHTX32.OCX" can be replaced completly.
    The "COMDLG32.OCX" can be replaced completly.
    The "COMCT332.OCX" can be replaced completly.
    The "MCIWNDX.OCX" (shipped with VB5) can be replaced completly.
    The "SYSINFO.OCX" can be replaced completly.

    Following controls are available at the moment:

    - Animation
    - CheckBoxW
    - ComboBoxW
    - CommandButtonW
    - CommandLink
    - CoolBar
    - CommonDialog (Class Module)
    - DTPicker
    - FontCombo
    - FrameW
    - HotKey
    - ImageCombo
    - ImageList
    - IPAddress
    - LabelW
    - LinkLabel
    - ListBoxW
    - ListView
    - MCIWnd
    - MonthView
    - OptionButtonW
    - Pager
    - ProgressBar
    - RichTextBox
    - Slider
    - SpinBox
    - StatusBar
    - SysInfo
    - TabStrip
    - TextBoxW
    - ToolBar
    - TreeView
    - UpDown

    Unicode is supported for all the stated controls. Also these are full DPI-Aware.

    At design time (IDE) there is only one dependency. (OLEGuids.tlb)
    This is a modified version of the original .tlb from the vbaccelerator website.
    But for the compiled .exe there are no dependencies, because the .tlb gets then compiled into the executable.

    Everything should be self explained, because all functions and properties have a description.

    The source code of the project can also be viewed on GitHub.

    This Demo shows of how to make the ToolBar control accessible per shortcut key on a MDIForm.

    ActiveX Control version, together with a Registration-Free (Side-by-side) solution:
    Version 1.6

    Thanks to MountainMan for the
    Documentation and Update/Compile Utility

    - When using the SetParent or MoveWindow API, pass .hWndUserControl and not .hWnd.
    - When changing the "Project Name", have all forms open, else all properties are lost. Because the library to which the controls are referring to is the "Project Name" itself. Having all forms open will ensure that the .frx files will be updated with the new "Project Name".
    - In order to trap error raises via "On Error Goto ..." or "On Error Resume Next" it is necessary to have "Break on Unhandled Errors" selected instead of "Break in Class Module" on Tools -> Options... -> General -> Error Trapping.

    List of revisions:
    - Internal improvement for the Transparent property in all affected controls.
      The internal transparent brush will be reset automatically upon UserControl_Resize.
      As side-effect it also fixes the cluttered background on non-integral DPI.
    - Change of how to achieve DPI-awareness to the controls for non-integral DPI.
      It's just a better technique now which reduces the number of resizes.
      However, the change has no visible impact for the end-user.
    - Cosmetic bugfix in the DPICorrectionFactor() function in Common.bas.
      It now returns a factor - by definition - in which a result shall be multiplied.
      Before this bugfix the result must be divided, which was odd.
    - Modified OLEGuids.tlb as following: (compiled with same uuid)
      - included interface IOleInPlaceObject.
      Unregister to old OLEGuids.tlb is not necessary, just overwrite the file.
    - Bugfix that the .Tag property of 'TbrButtonMenu' was not restored from the PropertyBag in the ToolBar control.
    - BackColor property works now also when VisualStyles is False in the TabStrip control.
    - Included the DoubleBuffer property in the TabStrip control.
    - Included the BackColor property and improved the DrawBackground method in the TabStrip control.
    - Modified OLEGuids.tlb as following: (compiled with same uuid)
      - enriched interface IOleObject with more methods.
      Unregister to old OLEGuids.tlb is not necessary, just overwrite the file.
    - Included enum value 'RtfFindOptionReverse' for the Find method in the RichTextBox control.
    - UTF-16 BOM was missing in the internal StreamFileOut function in the RichTextBox control.
      This fix is only meaningful when using 'RtfLoadSaveFormatUnicodeText' in the SaveFile method.
    - Included the SelLink run-time property in the RichTextBox control.
    - Potential double MouseUp event (not on double click; normal click) before and after MouseDown fixed on certain conditions in the ListView/TreeView control.
    - It is now possible for the LvwListItems collection to change the key on a particular LvwListItem in the ListView control.
    - VTable bugfix in the ListView control. (Unstable condition when internal SysHeader32 control had focus)
    - Minor improvement of the Locked property in the ComboBoxW, FontCombo and ImageCombo control.
    - Minor internal improvement.
    - Bugfix in the internal ComCtlsTopParentValidateControls function.
    - Minor bugfix in each WM_MOUSEACTIVATE handler.
    - Bugfix in the HDN_BEGINFILTEREDIT handler in the ListView control.
    - Improvement in VTableHandle.bas concerning 'DeactivateIPAO'.
    - Bugfix that the PanelClick event fired two times when double clicking in the StatusBar control.
    - Elimination of difference between StdEXE and OCX version. All UserControls in StdEXE now implements IObjectSafety.
    - GDI leak fixed when ListView/TreeView/CommandLink/CommandButtonW/OptionButtonW/CheckBoxW is nested in another UserControl and has the ImageList property set at design-time.
    - Replaced WM_CHANGEUISTATE with WM_UPDATEUISTATE in VisualStyles.bas.
    - GDI leak fixed when ToolBar/CoolBar/TabStrip/ImageCombo is nested in another UserControl and has the ImageList property set at design-time.
    - When the SelectItem function changes the index then the Click event will now be fired in the ComboBoxW control.
    - Bugfix in the Slider control related to ModifyTipText event.
    - StatusBar control can now render 32bpp alpha bitmaps.
    - Further improvement of VisualStyles.bas.
    - CommandButtonW/CheckBoxW/OptionButtonW controls now draw themed on vbButtonGraphical by their own.
      This way the ForeColor property can be used on vbButtonGraphical even when themed.
    - VisualStyles.bas modified to only consider VB intrinsic CommandButton/CheckBox/OptionButton controls.
      It also now use WM_QUERYUISTATE to consider if focus rect or accel should be drawn.
    - Minor internal improvement in the RichTextBox control related to theming.
    - Picture property in the FrameW control can now render 32bpp alpha bitmaps.
    - Preview in PPImageListImages.pag can now render 32bpp alpha bitmaps.
      The ImageList control itself already supported this when the ColorDepth property was set to 32bit.
    - Internal improvement in the BitmapHandleFromPicture function in Common.bas.
    - CommandButtonW/CheckBoxW/OptionButtonW better draws now disabled pictures in vbButtonGraphical style.
      This has only effect when no DisabledPicture is provided and it draws the normal Picture object as disabled.
    - VBA bugfix.
    - Bugfix when loading a non-unicode file with RtfLoadSaveFormatUnicodeText in the RichTextBox control.
    - Improvement in VTableHandle.bas concerning 'DeactivateIPAO'.
    - Bugfix in the UseShortestDayNames property in the MonthView control.
    - Major perfomance boost when reading .Text or .TextRTF in the RichTextBox control.
      This was achieved by reducing the number of 'ReDim Preserve' in the internal RtfStreamCallbackStringOut function.
    - Internal improvement concerning design-mode handling.
    - Minor internal improvement in the 'VTableCall' function.
    - Bugfix in VTableHandle.bas concerning 'DeactivateIPAO'.
      This bug ensures that all kinds of *_Terminate events are fired earlier (on unload) and not on app shutdown.
    - Use of lightweight COM object IRichEditOleCallback in RichTextBoxBase.bas.
      RtfOleCallback.cls got obselete and was removed.
    - Use of lightweight COM object IEnumVARIANT in VTableHandle.bas.
      Enumeration.cls got obsolete and was removed.
    - Major performance improvement in the 'ComboItems' collection in the ImageCombo control.
    - Internal bugfix in the ImageList control.
    - Internal improvement in the LabelW control.
    - Less memory consumption for LvwListItem. (~5MB each 100k items)
    - Performance boost for the .Remove method in TvwNodes.
    - Use of lightweight COM object IPrintDialogCallback instead of a WH_CALLWNDPROCRET hook for ShowPrinterEx in the CommonDialog class.
      This change only effects when the HookEvents property is True in the CommonDialog class.
    - Minor internal improvement in LlbLinks/LlbLink in the LinkLabel control.
    - Fix on EM_REPLACESEL (wparam = 1) in TextBoxW and RichTextBox control.
    - WM_SYSKEYDOWN/WM_SYSKEYUP considered now for KeyDown/KeyUp events.
    - Bugfix in the For Each...Next Enumeration of 'VirtualListItems' in the ListView control.
    - Included 'VirtualListItems' in the ListView control that returns a collection of virtual list items.
      New components LvwVirtualListItems.cls/LvwVirtualListItem.cls are included.
    - Performance boost when adding very large number of buttons in a ToolBar control.
    - Bugfix in the NoImage property of a Button in the ToolBar control.
    - GDI leak fixed when CoolBar is nested in another UserControl and has child controls applied.
    - Minor internal improvement in the Pager, FontCombo and UpDown control concerning BuddyControl.
    - GDI leak fixed when BuddyControl is set in the Pager control.
    - Minor internal improvement in the IPAddress and TextBoxW control.
    - Included the BuddyControl feature in the FontCombo control.
    - TEXTMETRIC structure was declared as ANSI. Fixed to WIDE version.
      Unicode did not lack due to this bug, but it was a memory risk as WIDE version is larger than ANSI.
    - Another internal GDI leak (minor) fixed in the DTPicker and ComboBoxW control.
    - Internal GDI leak fixed in the ListBoxW and FontCombo control. (forgot to restore old font handle in a hDCScreen)
    - Included the FontCombo control. Demo usage implemented into the RichTextBoxForm.
    - Included the AutoSelect property in the ComboBoxW control.
      If turned on it allows to automatically select items after each user input in the edit portion.
    - Internal bugfix in the DTPicker control that affects the drop-down on comctl version 5.8x and 6.0. (6.1 and above not concerned)
    - Minor internal improvement in the ListBoxW control.
    - Bugfix in the Scroll event in the ComboBoxW and ImageCombo control.
    - Internal improvement in the ComboBoxW control concerning IntegralHeight handling and OwnerDrawVariable.
    - Internal improvement in ComCtlsBase.bas. (Sub ComCtlsShowAllUIStates)
    - Included the Caption property in the MCIWnd control.
    - Toolbox bitmap for the HotKey control improved. (cosmetic effect in the IDE)
    - Included the SelectItem function in the ComboBoxW control.
    - Bugfix in VTableHandle.bas related to 25-Feb-2018 update. (concerns unload stability in IDE only)
    - Fixed constant TVIS_STATEIMAGEMASK in the TreeView control. (like in ListView on 27-Feb-2018 update)
    - Fixed potential crash in GetVirtualItem event in the ListView control.
      Also removed Count paramter in FindVirtualItem event. (Not needed, ListView.VirtualItemsCount can be used)
    - Included the VirtualMode/VirtualItemCount property and GetVirtualItem/FindVirtualItem event in the ListView control.
      Also included VirtualDisabledInfos property that allows to disable not needed virtual properties and to increase performance. (less GetVirtualItem event calls)
      All normal list view events are supported. However, passed ListItem objects are limited in their functionality when VirtualMode is on.
      Several functions/properties/methods are disabled (error raise) when VirtualMode is on.
    - Added VirtualControlsForm into the demo project to demonstrate the virtual list view.
    - Fixed constant LVIS_STATEIMAGEMASK in the ListView control. (should be &HF000& instead of &HF000)
      The missing & resulted in a value of -4096 instead of 61440.
      However, MS ListView was apparently flexible enough and accepted state mask -4096 as 61440 in LVM_GETITEMSTATE.
      But -4096 would fail in a callback testing situation. (LVN_GETDISPINFO; not used now for that)
    - Major internal improvement in the VTableHandle.bas concerning IOleInPlaceActiveObject.
    - Unicode support when generating ASCII key combos, e.g. ALT + 3333.
      It affects almost all controls, but most important are the TextBoxW and RichTextBox control.
    - Included the HeaderMousePointer property in the ListView control.
    - Included the MaxTextRows property in the ToolBar control.
    - Bugfix "DPI Aware" in the TreeView control. (Indentation property)
    - Included the CheckedIndices function in the ListBoxW control.
    - Included the CheckedIndices and GhostedIndices function in the ListView control.
    - Minor behavior change in the Click event of the OptionButtonW control.
    - Fixed constant ILD_FOCUS in the ImageList control. (should be &H2 instead of &H4)
      This impacts the enum value 'ImlDrawFocus'.
    - Modification in the FrameW control so it supports mouse down events and clicks of itself and windowless controls on it.
      This has been achieved by the expense of the HelpContextID support. It was not practical possible to support both.
    - Improved the WM_MOUSEWHEEL handler for fine-grained wheel changes in the TabStrip, MonthView and DTPicker control.
    - Improved VTableHandle.bas so it does not crash anymore when using VBCCRxx.OCX and VBFLXGRDxx.OCX in paralell. (concerns ActiveX control only)
    - ClipControls property set to True in the Pager control's UserControl properties.
    - Bugfix in the PPStatusBarPanels/PPToolBarButtons/PPCoolBarBands property page that the ForeColor property could perhaps not be applied.
      It is also necessary to replace SbrPanelProperties/TbrButtonProperties/CbrBandProperties class module.
    - Bugfix "DPI Aware" in the StatusBar control. (Panel.MinWidth)
      Also the StatusBar control does not crash anymore in the VBA environment.
    - Again minor tweaks to run better in the VBA environment. (meaningful for OCX only)
    - Included 'ToolTipText' parameter in the .ListSubItems.Add method in the ListView control.
    - Included the 'Exists' function in the class collections.
      The function returns True if the specified index or key exists in a collection.
    - Minor tweaks to run better in the VBA environment. (meaningful for OCX only)
    - GDI leak fixed in the ImageList control.
    - Bugfix in the VerticalGripper property in the CoolBar control.
    - Bugfix that the HideCaption property of a Band was not written to the property bag in the CoolBar control.
    - The ForeColor property is not anymore ignored when visual styles are applied in the CoolBar control.
      This improvement works only on Vista+ (minimum comctl32.dll 6.1).
      Also a glitch on a vertical orientation CoolBar with VerticalGripper property set to True got fixed. (even in Windows XP)
      These enhancements can be switched off by the conditional compilation constant 'ImplementThemedReBarFix'.
    - Included the DoubleBuffer property in the CoolBar control.
    - Some other minor internal improvements.
    - Performance improvement in the ToolBar control. This was done internally at some points by invalidating instead of refreshing.
    - Bugfix in the SelFontName property in the RichTextBox control.
    - The FrameW control supports now the WM_PRINTCLIENT message.
      This is necessary so a WM_PRINT message with PRF_CLIENT can be sent to the FrameW control via SendMessage.
    - Included the DoubleBuffer property in the StatusBar control that reduces flicker significantly.
    - Improved the DoubleBuffer property in the ToolBar control.
      The BackColor and Transparent property will work now even if double-buffering is used.
    - Included the Change event in the ProgressBar control.
    - Included DataBinding to the ProgressBar control. (Value property)
    - Included the ShowInTaskBar property in the ProgressBar control.
      Functions 'SetTaskBarProgressState', 'SetTaskBarProgressValue' and enum 'PrbTaskBarStateConstants' therefore has been removed.
    - Some other minor internal improvements.
    - Renamed enum constant 'PrbStateInProgress' to 'PrbStateNormal' (State property) in the ProgressBar control.
    - Removed the Marquee property as it got replaced by the new enum constant 'PrbScrollingMarquee' (Scrolling property) in the ProgressBar control.
    - Major internal improvement in the ListView control. Like the MS ListView the texts are now set with LPSTR_TEXTCALLBACK.
      So the strings are saved only in the Class and not also in the ListView itself.
      The memory usage is now much less, at the expense of slightly slower display time. (Negligible)
    - Less flickering in the ToolBar control and some minor internal improvements in the ListView control.
    - Internal improvement in the CommonDialog class. (meaningful for the ActiveX Version)
    - Included the ResetForeColors method in the ListView and TreeView control.
    - Tiny bugfix that the ListSubItems now display the default ForeColor of the ListView when not set explicitly.
    - Graphical style CommandButtonW, CheckBoxW and OptionButtonW controls will not be drawn themed anymore when the VisualStyles property is set to False.
      Therefore VisualStyles.bas got improved to draw themed only when the GetWindowTheme API returned <> 0.
    - Bugfix that UserControl_ReadProperties crashes in the LabelW control. (related to 02-Sep-2017 update)
    - Included the MouseEnter/MouseLeave event and MouseTrack property in the IPAddress control.
    - Included the FindSubItem function in the ListView control.
    - The Font properties are not written to the property bags anymore when it equals to Ambient.Font.
      Included new function OLEFontIsEqual in Common.bas.
    - Renamed the Border property to 'BorderStyle' in the CoolBar control.
    - Included the MouseEnter/MouseLeave event and MouseTrack property in the CoolBar control.
    - Included the BandMouseEnter/BandMouseLeave event in the CoolBar control.
      This enables more specific handling of a single band instead of the global MouseEnter/MouseLeave event.
    - Bugfix that the Alignment property of a ColumnHeader returned always 0 in the ListView control.
      This happened because LVCFMT_LEFT is defined as &H0 and was checked first. Now the check order is reversed and begins with LVCFMT_CENTER.
    - The PictureAlignment property will be adjusted now when changing the RightToLeft property in the FrameW control. (like the Alignment property)
    - Included the MouseEnter/MouseLeave event and MouseTrack property in the SpinBox control.
    - Included the PictureAlignment property in the FrameW control.
    - Alpha (32bpp) icons now drawn correctly per DrawIconEx instead of Picture.Render.
      Affected are the FrameW (Picture), StatusBar (Picture of Panel) and ImageList (Images Property Page) control.
    - Included the Picture property in the FrameW control.
    - Bugfix in the Font property in the FrameW control. (related to 03-Jul-2017 update)
    - Internal improvement in the ToolBar and CoolBar control.
    - Some other minor internal improvements.
    - Included the Scroll event in the ComboBoxW and ImageCombo control.
      Like in the ListBoxW control it will be fired whenever the TopIndex have been changed, either by code or by user action.
    - Included the EndLabelEdit method in the TreeView and ListView control.
    - Included the UseShortestDayNames property in the MonthView control.
    - Included the CalendarUseShortestDayNames property in the DTPicker control.
    - Internal improvement in the LinkLabel control.
    - Some minor internal improvements related to 15-Aug-2017 update.
    - Internal improvement on all controls which do internal resizing to certain boundaries, e.g. MonthView control.
      Full elimination of UserControl.Size method, even if DPICorrectionFactor() equals 1.
    - First release.
    Name:  ComCtlsDemo.jpg
Views: 17461
Size:  118.9 KB
    Attached Files Attached Files
    Last edited by Krool; Oct 13th, 2019 at 12:17 PM.

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