dcsimg
Results 1 to 40 of 2829

Thread: CommonControls (Replacement of the MS common controls)

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,535

    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
    - VirtualCombo

    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

    Notes:
    - 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".

    List of revisions:
    Code:
    28-May-2020
    - WM_UNICHAR handler now supports surrogate pairs. (UTF32 conversion)
    26-May-2020
    - SimpleText property now uses SBT_RTLREADING in case RightToLeft is True in the StatusBar control.
    - Changed IncrementalSearch event params in the VirtualCombo control.
    25-May-2020
    - Behavior bugfixes in the VirtualCombo control when Style is <> DropDownList.
    - Included DrawMode property in the VirtualCombo control.
      Only options are Normal and OwnerDrawFixed. (OwnerDrawVariable not possible due to LBS_NODATA restriction)
    24-May-2020
    - Included the VirtualCombo control. (super-classed combo box control with a no-data list box portion)
      The .ListCount property is write-able and populates the list very quickly.
      GetVirtualItem event retrieves the item strings.
      IncrementalSearch/FindVirtualItem event can also be handled to enable full functionality.
    21-May-2020
    - Included the DrawMode property in the Slider control.
    20-May-2020
    - Major internal improvement for ImageCombo as no WM_MOUSEACTIVATE overhead necessary anymore.
    - Improvement for the WM_NCPAINT handler in the RichTextBox control.
    - Included a WM_NCPAINT handler for the HotKey control to resolve msctls_hotkey32 class bugs. (it behaves then like an edit control)
    18-May-2020
    - Included SortType LvwSortTypeLogical in the ListView control.
    - Bugfix related to 08-May-2020 update. (WM_PRINTCLIENT in IPAddress control)
    17-May-2020
    - Bugfix in the Add method of LvwColumnHeaders in the ListView control.
    - Included Text property (read-only) in the HotKey control.
    - BackColor property in the HotKey control works now also when Enabled = False.
    - Major internal improvement for HotKey as no WM_MOUSEACTIVATE overhead necessary anymore.
    09-May-2020
    - UserControl.Cls added in the UserControl_Paint event in the IPAddress control.
    08-May-2020
    - The IPAddress control supports now the WM_PRINTCLIENT message.
      This was lost due to the rebuild from scratch as of 17-Apr-2020. (no longer use of SysIPAddress32 class)
    07-May-2020
    - Width property of a Panel in the StatusBar control not read-only anymore. It behaves as the MS StatusBar.
    06-May-2020
    - Removed the BackColor property in the DTPicker control for simplification.
      It was anyhow not possible anymore as of Vista+ ..
    04-May-2020
    - Included Font/Text/TextColor property in the ProgressBar control.
      Text placeholders: {0} = Value, {1} = Min, {2} = Max and {3} = Percent value between 0 and 100.
    03-May-2020
    - Major internal improvement for LinkLabel/MonthView/ComboBoxW/FontCombo as no WM_MOUSEACTIVATE overhead necessary anymore.
    - Other minor internal improvements.
    30-Apr-2020
    - Internal improvement in the OptionButtonW control.
    28-Apr-2020
    - Property bag for the CheckBoxW/CommandButtonW/OptionButtonW/FrameW caption's property not unicode anymore. (like LabelW from beginning)
      This avoids some .frx refs as there is no property page anyway for these available to input unicode in the IDE.
      No problem occurs with existing property bags, so no compatibility break.
    - Other minor internal improvements in the ListView control.
    27-Apr-2020
    - Bugfix in the ListView control.
      - The ItemFocus event is now able to fire at first item insertion. (Index = 1)
      - The ItemFocus event will not have an Item set as 'Nothing' anymore when clearing the list. (mis-feature)
    26-Apr-2020
    - Bugfix in the GetClipboardText function in Common.bas.
    23-Apr-2020
    - FrameW responds now to WM_SETTEXT/WM_GETTEXT/WM_GETTEXTLENGTH like the VB.Frame.
    22-Apr-2020
    - Bugfix that an OwnerDrawn OptionButtonW did not raise the Click event, though the value got changed.
    20-Apr-2020
    - Major Bugfix in the CheckBoxW/CommandButtonW/CommandLink/LinkLabel/OptionButtonW control.
      Forgot to call DeActivateIPAO method upon WM_KILLFOCUS.
    - DPI-aware bugfix in the Slider control.
    - Major internal improvement for SpinBox as no WM_MOUSEACTIVATE overhead necessary anymore.
    19-Apr-2020
    - Internal improvement in ComCtlsBase.bas.
    - Improvement for Animation control.
      - No re-creation anymore when changing BackColor property.
      - Default value for AutoPlay property now False instead of True. (like in the original MS control)
      - StartPlay and IsPlaying renamed to Play and Playing in the Animation control. (like in the original MS control)
      - StartedPlay/StoppedPlay event merged into new Change event. (more VB-ish, use .Playing to determine current status)
    18-Apr-2020
    - Major internal improvement for ListView as no WM_MOUSEACTIVATE overhead necessary anymore.
    - Renamed the Border property to 'BorderStyle' in the RichTextBox control. (like in the original MS control)
    17-Apr-2020
    - Major internal improvement in the IPAddress control as SysIPAddress32 class no longer used.
      Instead everything is done from scratch within the UserControl and four internal edit controls.
      The behavior and usage is 100% mimic, but looks more "VB-ish".
      - BackColor property now possible.
      - ForeColor property also effects now the three dots.
      - UserControl_Resize does not need a re-creation. (SysIPAddress32 was fixed, no MoveWindow was possible!)
      - BorderStyle property now possible. (e.g. Flat style)
      - Design time property page included.
      - Support for SysIPAddress32 IPM_* messages.
    15-Apr-2020
    - Modified OLEGuids.tlb as following: (compiled with same uuid)
      - included hWnd param for IOleInPlaceActiveObjectVB and IOleControlVB
      Unregister to old OLEGuids.tlb is not necessary, just overwrite the file.
    - Bugfix in the various WM_CONTEXTMENU handlers. It can now also handle negative screen coordinates.
    13-Apr-2020
    - Behavior improvement for the LabelW control. (when AutoSize property set to True)
      It now sets a temporary NULL clipping region in that case, like the VB.Label does.
    - Major internal improvement for Slider/TabStrip as no WM_MOUSEACTIVATE overhead necessary anymore.
    - Minor internal improvement in the TextBoxW and RichTextBox control.
    12-Apr-2020
    - Major internal improvement for TreeView as no WM_MOUSEACTIVATE overhead necessary anymore.
    - Bugfix in the Checkboxes property in the TreeView control.
    11-Apr-2020
    - Major internal improvement for TextBoxW/RichTextBox/DTPicker/ListBoxW as no WM_MOUSEACTIVATE overhead necessary anymore.
    - Behavior improvement for vbOLEDragAutomatic in the TextBoxW/ListBoxW control. (OLEDragMode property)
    07-Apr-2020
    - Major internal improvement for CheckBoxW/CommandButtonW/OptionButtonW/CommandLink as no WM_MOUSEACTIVATE overhead necessary anymore.
    06-Apr-2020
    - Minor internal improvement in the TabStrip and TreeView control.
    29-Mar-2020
    - Included the ShowColumnTips property in the ListView control to enable tooltips on the column headers.
      Therefore ToolTipText, ToolTipTextFilterBtn and ToolTipTextDropDown property are included of a ColumnHeader in the ListView control.
    - It is now possible for the LvwColumnHeaders collection to change the key on a particular LvwColumnHeader in the ListView control.
    28-Mar-2020
    - It is now possible for the ImcComboItems collection to change the key on a particular ImcComboItem in the ImageCombo control.
    - Some other minor cleanup.
    22-Mar-2020
    - Bugfix in the CreateGDIFontFromOLEFont function. (Common.bas)
    - Minor speed optimization in the LabelW control for auto-sizing.
      Usage of function 'GDIFontFromOLEFont' instead of 'CreateGDIFontFromOLEFont'.
    - Minor internal improvement in the CommonDialog class.
    04-Mar-2020
    - Internal improvement for ShowPrinter/ShowPrinterEx/ShowPageSetup dialog in the CommonDialog class.
      The DevMode plays now by the rules. (https://support.microsoft.com/en-us/help/167345/how-to-modify-printer-settings-with-the-documentproperties-function)
    27-Feb-2020
    - Behavior change for returning printer params for ShowPrinter/ShowPrinterEx dialog in the CommonDialog class.
    26-Feb-2020
    - TreeView control now 'Alignable', so that it can be used in an MDIForm. (e.g. as 'menu tree')
    25-Feb-2020
    - SetFocus method of FrameW removed. (Cleanup)
      This was a left-over after 13-Jan-2018 update where 'CanGetFocus' was changed to False.
    - Changed Value property in the HotKey control so it works in VB.net AxInterop.
      Optional 'ByRef Modifiers' param was changed from 'As VBRUN.ShiftConstants' to 'As Integer'.
    - Changed params for PanelClick/PanelDblClick in the StatusBar control.
      It now includes the 'Button As Integer' param.
    - ContainerKeyDown in the ToolBar control changed from 'Sub' to 'Function'.
      It can now return a reference to a TbrButton class, when a successfull button click was invoked.
    - Included run-time function FindMnemonic in the ToolBar control.
    20-Feb-2020
    - Bugfix related to 19-Feb-2020.
    19-Feb-2020
    - Bugfix in the LabelW control when WordWrap and AutoSize are both set to True.
    14-Feb-2020
    - Bugfix that CommonDialog.ShowPrinterEx does not crash anymore on a form-less application.
      CommonDialog.ShowPrinter was not affected as it can deal also without an owner window.
    12-Feb-2020
    - Passing vbNullString to the AddItem method of the ComboBoxW control does not cause an error anymore.
    06-Feb-2020
    - Improvement (cosmetic, not a bug) in VTableHandle.bas so that IOleControl do not disturb anymore in IDE on debugging.
      This affects only the Std-EXE version (not OCX) and only when setting breakpoints. (F9, F8 etc.)
    - Minor internal improvement in the ToolBar control.
    15-Jan-2020
    - Improvement in the SystemStartOfWeek property in the DTPicker and MonthView control.
    - Bugfix for the StatusBar control when having multiple 'AutoSizeSpring' panels.
    14-Jan-2020
    - Improvement in the PasswordChar property in the TextBoxW and RichTextBox control.
    09-Jan-2020
    - Included the CustomColors property (Variant) in the CommonDialog class.
      16 custom colors can be retrieved or changed via an array.
    05-Jan-2020
    - Improvement in VTableHandle.bas as IPerPropertyBrowsing must NOT be subclassed anymore.
      No VTable remains subclassed, therefore VTableSubclass.cls got obselete and was removed!
    - Modified OLEGuids.tlb as following: (compiled with same uuid)
      - bugfix interface IPerPropertyBrowsing.
      Unregister to old OLEGuids.tlb is not necessary, just overwrite the file.
    03-Jan-2020
    - Improvement in VTableHandle.bas as IOleControl must NOT be subclassed anymore.
      It is necessary to replace also all controls. (.ctl)
    28-Dec-2019
    - Minor internal improvement in the ContainerKeyDown method in the ToolBar control.
    26-Dec-2019
    - Minor internal improvement in the..
      - RestoreRecent property in the FontCombo control.
      - WorkAreas/ColumnOrder property in the ListView control.
      - TileViewIndices property of a ListItem in the ListView control.
      - SetAcceleration method in the SpinBox control.
    15-Nov-2019
    - It is now possible for the TvwNodes collection to change the key on a particular TvwNode in the TreeView control.
    25-Oct-2019
    - No crash anymore when getting the Hint property in 'LvwGroup' in the ListView control.
    13-Oct-2019
    - 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.
    09-Oct-2019
    - 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.
    08-Oct-2019
    - 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.
    05-Oct-2019
    - Modified OLEGuids.tlb as following: (compiled with same uuid)
      - included interface IOleInPlaceObject.
      Unregister to old OLEGuids.tlb is not necessary, just overwrite the file.
    11-Sep-2019
    - Bugfix that the .Tag property of 'TbrButtonMenu' was not restored from the PropertyBag in the ToolBar control.
    24-Aug-2019
    - BackColor property works now also when VisualStyles is False in the TabStrip control.
    - Included the DoubleBuffer property in the TabStrip control.
    22-Aug-2019
    - 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.
    21-Aug-2019
    - Included enum value 'RtfFindOptionReverse' for the Find method in the RichTextBox control.
    20-Aug-2019
    - 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.
    15-Aug-2019
    - Included the SelLink run-time property in the RichTextBox control.
    11-Aug-2019
    - Potential double MouseUp event (not on double click; normal click) before and after MouseDown fixed on certain conditions in the ListView/TreeView control.
    10-Aug-2019
    - It is now possible for the LvwListItems collection to change the key on a particular LvwListItem in the ListView control.
    09-Jul-2019
    - VTable bugfix in the ListView control. (Unstable condition when internal SysHeader32 control had focus)
    14-May-2019
    - Minor improvement of the Locked property in the ComboBoxW, FontCombo and ImageCombo control.
    11-May-2019
    - Minor internal improvement.
    23-Apr-2019
    - Bugfix in the internal ComCtlsTopParentValidateControls function.
    26-Mar-2019
    - Minor bugfix in each WM_MOUSEACTIVATE handler.
    25-Mar-2019
    - Bugfix in the HDN_BEGINFILTEREDIT handler in the ListView control.
    10-Mar-2019
    - Improvement in VTableHandle.bas concerning 'DeactivateIPAO'.
    26-Feb-2019
    - 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.
    19-Feb-2019
    - GDI leak fixed when ListView/TreeView/CommandLink/CommandButtonW/OptionButtonW/CheckBoxW is nested in another UserControl and has the ImageList property set at design-time.
    18-Feb-2019
    - 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.
    15-Feb-2019
    - When the SelectItem function changes the index then the Click event will now be fired in the ComboBoxW control.
    10-Feb-2019
    - Bugfix in the Slider control related to ModifyTipText event.
    - StatusBar control can now render 32bpp alpha bitmaps.
    07-Feb-2019
    - Further improvement of VisualStyles.bas.
    06-Feb-2019
    - 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.
    02-Feb-2019
    - 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.
    29-Jan-2019
    - 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.
    23-Jan-2019
    - VBA bugfix.
    21-Jan-2019
    - Bugfix when loading a non-unicode file with RtfLoadSaveFormatUnicodeText in the RichTextBox control.
    17-Jan-2019
    - Improvement in VTableHandle.bas concerning 'DeactivateIPAO'.
    - Bugfix in the UseShortestDayNames property in the MonthView control.
    06-Jan-2019
    - 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.
    11-Nov-2018
    - Internal improvement concerning design-mode handling.
    05-Nov-2018
    - Minor internal improvement in the 'VTableCall' function.
    30-Oct-2018
    - 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.
    29-Oct-2018
    - Use of lightweight COM object IEnumVARIANT in VTableHandle.bas.
      Enumeration.cls got obsolete and was removed.
    27-Oct-2018
    - Major performance improvement in the 'ComboItems' collection in the ImageCombo control.
    - Internal bugfix in the ImageList control.
    23-Oct-2018
    - Internal improvement in the LabelW control.
    - Less memory consumption for LvwListItem. (~5MB each 100k items)
    - Performance boost for the .Remove method in TvwNodes.
    22-Oct-2018
    - 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.
    20-Oct-2018
    - Minor internal improvement in LlbLinks/LlbLink in the LinkLabel control.
    12-Oct-2018
    - Fix on EM_REPLACESEL (wparam = 1) in TextBoxW and RichTextBox control.
    09-Oct-2018
    - WM_SYSKEYDOWN/WM_SYSKEYUP considered now for KeyDown/KeyUp events.
    28-Sep-2018
    - Bugfix in the For Each...Next Enumeration of 'VirtualListItems' in the ListView control.
    27-Sep-2018
    - Included 'VirtualListItems' in the ListView control that returns a collection of virtual list items.
      New components LvwVirtualListItems.cls/LvwVirtualListItem.cls are included.
    21-Sep-2018
    - 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.
    
    [...]
    
    11-Nov-2012
    - First release.
    Name:  ComCtlsDemo.jpg
Views: 22342
Size:  118.9 KB

    Warning: This Std-EXE version here is not really IDE-Safe as the design-time (form designer) user control subclassing (AddressOf pointer) can just become invalid when the IDE wants to. It is recommended to use the OCX version.
    Attached Files Attached Files
    Last edited by Krool; Yesterday at 09:35 AM.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width