dcsimg
Page 1 of 62 12341151 ... LastLast
Results 1 to 40 of 2443

Thread: CommonControls (Replacement of the MS common controls)

  1. #1

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

    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

    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".
    - 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:
    Code:
    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.
    16-Sep-2018
    - GDI leak fixed when CoolBar is nested in another UserControl and has child controls applied.
    06-Sep-2018
    - Minor internal improvement in the Pager, FontCombo and UpDown control concerning BuddyControl.
    02-Sep-2018
    - GDI leak fixed when BuddyControl is set in the Pager control.
    15-Aug-2018
    - Minor internal improvement in the IPAddress and TextBoxW control.
    13-Aug-2018
    - Included the BuddyControl feature in the FontCombo control.
    12-Aug-2018
    - 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.
    02-Aug-2018
    - Another internal GDI leak (minor) fixed in the DTPicker and ComboBoxW control.
    28-Jul-2018
    - Internal GDI leak fixed in the ListBoxW and FontCombo control. (forgot to restore old font handle in a hDCScreen)
    08-Jul-2018
    - Included the FontCombo control. Demo usage implemented into the RichTextBoxForm.
    15-Jun-2018
    - 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.
    02-Jun-2018
    - 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)
    18-Apr-2018
    - Minor internal improvement in the ListBoxW control.
    15-Apr-2018
    - Bugfix in the Scroll event in the ComboBoxW and ImageCombo control.
    10-Apr-2018
    - Internal improvement in the ComboBoxW control concerning IntegralHeight handling and OwnerDrawVariable.
    28-Mar-2018
    - Internal improvement in ComCtlsBase.bas. (Sub ComCtlsShowAllUIStates)
    23-Mar-2018
    - Included the Caption property in the MCIWnd control.
    - Toolbox bitmap for the HotKey control improved. (cosmetic effect in the IDE)
    07-Mar-2018
    - Included the SelectItem function in the ComboBoxW control.
    04-Mar-2018
    - 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)
    02-Mar-2018
    - Fixed potential crash in GetVirtualItem event in the ListView control.
      Also removed Count paramter in FindVirtualItem event. (Not needed, ListView.VirtualItemsCount can be used)
    01-Mar-2018
    - 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.
    27-Feb-2018
    - 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)
    25-Feb-2018
    - Major internal improvement in the VTableHandle.bas concerning IOleInPlaceActiveObject.
    20-Feb-2018
    - 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.
    19-Feb-2018
    - Included the HeaderMousePointer property in the ListView control.
    16-Feb-2018
    - Included the MaxTextRows property in the ToolBar control.
    - Bugfix "DPI Aware" in the TreeView control. (Indentation property)
    12-Feb-2018
    - Included the CheckedIndices function in the ListBoxW control.
    - Included the CheckedIndices and GhostedIndices function in the ListView control.
    17-Jan-2018
    - Minor behavior change in the Click event of the OptionButtonW control.
    14-Jan-2018
    - Fixed constant ILD_FOCUS in the ImageList control. (should be &H2 instead of &H4)
      This impacts the enum value 'ImlDrawFocus'.
    13-Jan-2018
    - 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.
    21-Dec-2017
    - Improved the WM_MOUSEWHEEL handler for fine-grained wheel changes in the TabStrip, MonthView and DTPicker control.
    09-Dec-2017
    - Improved VTableHandle.bas so it does not crash anymore when using VBCCRxx.OCX and VBFLXGRDxx.OCX in paralell. (concerns ActiveX control only)
    24-Nov-2017
    - ClipControls property set to True in the Pager control's UserControl properties.
    21-Nov-2017
    - 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.
    04-Nov-2017
    - Bugfix "DPI Aware" in the StatusBar control. (Panel.MinWidth)
      Also the StatusBar control does not crash anymore in the VBA environment.
    27-Oct-2017
    - 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.
    22-Oct-2017
    - Included the 'Exists' function in the class collections.
      The function returns True if the specified index or key exists in a collection.
    20-Oct-2017
    - Minor tweaks to run better in the VBA environment. (meaningful for OCX only)
    06-Oct-2017
    - GDI leak fixed in the ImageList control.
    03-Oct-2017
    - 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'.
    02-Oct-2017
    - Included the DoubleBuffer property in the CoolBar control.
    - Some other minor internal improvements.
    29-Sep-2017
    - Performance improvement in the ToolBar control. This was done internally at some points by invalidating instead of refreshing.
    28-Sep-2017
    - Bugfix in the SelFontName property in the RichTextBox control.
    23-Sep-2017
    - 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.
    22-Sep-2017
    - 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.
    21-Sep-2017
    - 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.
    20-Sep-2017
    - 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.
    16-Sep-2017
    - 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)
    14-Sep-2017
    - 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)
    13-Sep-2017
    - Included the ResetForeColors method in the ListView and TreeView control.
    10-Sep-2017
    - Tiny bugfix that the ListSubItems now display the default ForeColor of the ListView when not set explicitly.
    09-Sep-2017
    - 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.
    06-Sep-2017
    - 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.
    05-Sep-2017
    - Included the FindSubItem function in the ListView control.
    02-Sep-2017
    - The Font properties are not written to the property bags anymore when it equals to Ambient.Font.
      Included new function OLEFontIsEqual in Common.bas.
    30-Aug-2017
    - 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.
    29-Aug-2017
    - 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)
    28-Aug-2017
    - Included the MouseEnter/MouseLeave event and MouseTrack property in the SpinBox control.
    27-Aug-2017
    - Included the PictureAlignment property in the FrameW control.
    26-Aug-2017
    - 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.
    25-Aug-2017
    - Included the Picture property in the FrameW control.
    23-Aug-2017
    - 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.
    22-Aug-2017
    - 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.
    21-Aug-2017
    - 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.
    
    [...]
    
    11-Nov-2012
    - First release.
    Name:  ComCtlsDemo.jpg
Views: 18381
Size:  118.9 KB
    Attached Files Attached Files
    Last edited by Krool; Nov 15th, 2019 at 02:52 AM.

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: CommonControlsEx (Replacement of the MS common controls)

    What is the benefit of using these over the existing controls?

    Does each control have the same properties? Do they have new properties?
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    The benefit is that these controls are linked to the comctl32.dll, that means they support the latest API calls, functions, properties and visual styles (themes).

    The existing common controls 6.0 from MS are not linked to the comctl32.dll, so they doesn't support the visual styles (themes).
    Reason why: The controls of the comct32.dll are compiled directly into the common controls 6.0 from MS, but as of state of a old version of comctl32.dll

    Only the common controls 5.0 from MS are linked to the comctl32.dll, but the COM hull is very old and so they have a leak of the latest functions and properties. Also controls like the DTPicker, MonthView or UpDown are not included.
    Last edited by Krool; Feb 28th, 2014 at 12:59 PM.

  4. #4
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The benefit is that these controls are linked to the comctl32.dll, that means they support the latest API calls, functions, properties and visual styles (themes).

    The existing common controls 6.0 from MS are not linked to the comctl32.dll, so they doesn't support the visual styles (themes).
    Reason why: The controls of the comct32.dll are compiled directly into the common controls 6.0 from MS, but as of state of a old version of comctl32.dll

    Only the common controls 5.0 from MS are linked to the comctl32.dll, but the COM hull is very old and so they have a leak of the latest functions and properties. Also controls like the DTPicker, MonthView or UpDown are not included.
    Can you please change the OLEGuids.tlb to a new name to avoid conflicts with my existing OLEGuids.tlb in system32 folder?

  5. #5
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Thumbs up Re: CommonControlsEx (Replacement of the MS common controls)

    Excellent work!

    Quote Originally Posted by Hack View Post
    What is the benefit of using these over the existing controls?

    Does each control have the same properties? Do they have new properties?
    In addition to what Krool stated, some folks, myself included, prefer that their apps have no dependencies whatsoever.

    The controls have most of the necessary (similarly named) properties and methods and many of them have some new ones as well (the VisualStyles property for instance).

    Quote Originally Posted by Jonney View Post
    Can you please change the OLEGuids.tlb to a new name to avoid conflicts with my existing OLEGuids.tlb in system32 folder?
    Open CommonControlsEx.vbp in any text editor and edit this line:

    Code:
    Reference=*\G{5B1EACE0-EDEB-11E1-AFF1-0800200C9A66}#1.0#0#..\..\..\..\WINDOWS\system32\OLEGuids.tlb#OLE Guid and interface definitions
    to:

    Code:
    Reference=*\G{5B1EACE0-EDEB-11E1-AFF1-0800200C9A66}#1.0#0#OLEGuids\OLEGuids.tlb#OLE Guid and interface definitions
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  6. #6

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Jonney View Post
    Can you please change the OLEGuids.tlb to a new name to avoid conflicts with my existing OLEGuids.tlb in system32 folder?
    You can just rename the file "OLEGuids.tlb" at your own, for example to "OLEGuids2.tlb"
    That is no problem, because the uuid and library name differs from the original. They can co-exist without conflicts.
    You just need to re-register it in the IDE. (Project -> References... -> Browse for file)
    Last edited by Krool; Nov 12th, 2012 at 01:18 PM.

  7. #7
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    You can just rename the file "OLEGuids.tlb" at your own, for example to "OLEGuids2.tlb"
    That is no problem, because the uuid and library name differs from the original. They can co-exist without conflicts.
    You just need to re-register it in the IDE. (Project -> References... -> Browse for file)
    Thanks. I understood.
    If you can add Unicode support, then those control can be used on PC with whatever locale setting.
    How about others control built by CreateWindowEx such as Listview/Treeview? Listview support more new features such as Grouping now.

  8. #8

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:02 AM.

  9. #9
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: CommonControlsEx (Replacement of the MS common controls)

    Thanks for the update!
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  10. #10

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.

    All controls support now Unicode and some other minor improvements are done.
    Last edited by Krool; Dec 15th, 2012 at 12:24 PM.

  11. #11
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.

    All controls support now Unicode and some other minor improvements are done.
    Fairly support Unicode.
    But because of nature of MS BUTTON, it doesn't an unicode compatible control.
    Never mind, just leave this because it's hard to fully support Unicode for a Command button.

    DrawText hDC, StrPtr(Button.Caption), -1, RectText, DT_CALCRECT Or DT_WORDBREAK
    Button.Caption can never be held Unicode string, internal conversion has been done before you call DrawTextW.

  12. #12
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Jonney View Post
    Button.Caption can never be held Unicode string, internal conversion has been done before you call DrawTextW.
    This function will retrieve any button's caption, even if VB displays their Unicode captions as ?????.

    Code:
    Private Declare Function DefWindowProcW Lib "user32.dll" (ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    
    Private Function GetCaption(ByRef oButton As Object) As String
        Const WM_GETTEXT = &HD&, WM_GETTEXTLENGTH = &HE&
        Dim Button_hWnd As Long
    
        On Error GoTo 1
        Button_hWnd = oButton.hWnd
        GetCaption = Space$(DefWindowProcW(Button_hWnd, WM_GETTEXTLENGTH, 0&, 0&))
        DefWindowProcW Button_hWnd, WM_GETTEXT, Len(GetCaption) + 1&, StrPtr(GetCaption)
    1   On Error GoTo 0
    End Function
    VB's Button controls (CommandButton, CheckBox or OptionButton) can actually contain Unicode captions (via DefWindowProcW + WM_SETTEXT). VB doesn't display them properly though.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  13. #13

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:04 AM.

  14. #14

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:06 AM.

  15. #15

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:09 AM.

  16. #16
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: CommonControlsEx (Replacement of the MS common controls)

    Thanks for including the StatusBar control!
    Last edited by Bonnie West; Mar 1st, 2013 at 04:52 PM.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  17. #17

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:12 AM.

  18. #18

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:16 AM.

  19. #19

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.

  20. #20
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.
    Thank you for consistent update.

  21. #21
    Frenzied Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    1,668

    Re: CommonControlsEx (Replacement of the MS common controls)

    Good Work!

  22. #22
    Lively Member
    Join Date
    Jun 2010
    Posts
    68

    Re: CommonControlsEx (Replacement of the MS common controls)

    its really an amazing work,god bless you.Bro can you add listview and treeview with displayable unicode support?
    it will great achievment if it possible

  23. #23
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Edited: Remove my Post regarding Balloon tooltips, Win8 has fixed the problem.
    Last edited by Jonney; Jan 26th, 2013 at 10:33 AM.

  24. #24
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Confirmed it is OS problem. The balloon tooltips works perfect on Win8.

    Edited: CommonControlsEx works On Win8.
    Last edited by Jonney; Jan 18th, 2013 at 02:32 AM.

  25. #25

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.

    ListView control is added.

    Groups and 'Tile' View are for the moment not included.
    It can replace 100% the ListView from „MSCOMCTL.OCX". (Exception: ToolTipText of the ListSubItems)
    But it has also many properties, methods and events more than the original.
    Last edited by Krool; Feb 3rd, 2013 at 03:17 PM.

  26. #26
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.

    ListView control is added.

    Groups and 'Tile' View are for the moment not included.
    It can replace 100% the ListView from „MSCOMCTL.OCX". (Exception: ToolTipText of the ListSubItems)
    But it has also many properties, methods and events more than the original.
    Thank you for additional Listview.
    From Vista/Win7,MS added lots of new features into Listview, such as enhanced grouping, Checkbox on Header,etc.
    Please consider adding checkbox and Text Edit for subitems.

  27. #27

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

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Jonney View Post
    Please consider adding checkbox and Text Edit for subitems.
    The comctl32.dll does not provide the ability to edit the labels of the subitems.
    Last edited by Krool; Feb 6th, 2013 at 06:08 AM.

  28. #28

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

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    ImageList control is completly rewritten. (It is not compatible with the previous version)

    It works now like the original ImageList from MS but with some improvements, for example that the Style flag of the ListImages Draw method can be combined with multiples styles. (That was not possible in the original ImageList from MS) or that the Overlay function returns an icon instead of a bitmap or that the BackColor can be turned on or off (UseBackColor property).

  29. #29
    Addicted Member
    Join Date
    Sep 2008
    Posts
    136

    Re: CommonControls (Replacement of the MS common controls)

    Awesome work! I am by far not knocking the work but asking a question.. Is the tab control text a little too far to the right?
    Last edited by brandoncampbell; Feb 26th, 2013 at 11:27 AM.

  30. #30

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

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by brandoncampbell View Post
    Is the tab control text a little too far to the right?
    I noticed that too. I think that is due to the new appearance of Windows 7.
    Last edited by Krool; Feb 27th, 2013 at 02:06 AM.

  31. #31
    Addicted Member
    Join Date
    Sep 2008
    Posts
    136

    Re: CommonControls (Replacement of the MS common controls)

    I think it has something to do with Mnemonics if you don't put the _ before the text it looks fine.

  32. #32
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    5,639

    Re: CommonControls (Replacement of the MS common controls)

    I must say I'm truly impressed. Were I still using VB6, this would have been an incredible source of knowledge. I tended to write alot of my own controls(I still do in VB.Net) and I always want to learn as much as possible about creating them. I thought I had a good handle on it it but one glance at your source code, and even what you described about them being linked to ComCtl32.Dll showed me just how little I actually knew about control authoring in VB6. I tip my hat to you sir.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  33. #33

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

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    ImageCombo control is added.

    The biggest advantage is that you can set the style property. ('DropDownCombo', 'DropDownList' or 'SimpleCombo')
    That was not possible on the original ImageCombo control. (It was always as 'DropDownCombo')
    Also new is the 'ItemDrag' event, similar to the one used in the ListView control.

  34. #34
    Addicted Member
    Join Date
    Sep 2008
    Posts
    136

    Re: CommonControls (Replacement of the MS common controls)

    Nice work dude
    Last edited by brandoncampbell; Mar 15th, 2013 at 02:01 PM.

  35. #35
    New Member
    Join Date
    Mar 2013
    Posts
    1

    Cool Re: CommonControls (Replacement of the MS common controls)

    Very, very good work. Many thanks to you. I do not like to link to Microsofts Ocx-files (Mscommctl.....). With your controls i don't need that. My exe work so without registrations on every PC. And: i can do more things. I can change the WM_PAINT - message to what i will. I can change the colors, i can add a picture, i can paint the control. I must only change your code a little bit. Awsome.
    Thank you very much!!!!!

  36. #36

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

    Re: CommonControls (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Apr 25th, 2013 at 03:02 PM.

  37. #37

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

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

  38. #38
    Lively Member
    Join Date
    Mar 2012
    Posts
    68

    Re: CommonControls (Replacement of the MS common controls)

    Thank you for the work - it's a lovely change CommonControls.
    I have one problem, very often crashes when you compile an application (even an example), and the exe-file is created. And sometimes crashes when you press End in the course of the program.
    It would be nice if the progress bar for added display of progress on the taskbar. An example can be found here http://sourceforge.net/p/audica/code...skBarList3.cls

  39. #39
    Lively Member
    Join Date
    Mar 2012
    Posts
    68

    Re: CommonControls (Replacement of the MS common controls)

    Also for the beautiful subsclassing commandbutton think it will be good to make changes if there is a caption and a picture, you have the image on the left and the caption to the left of the picture. So the picture will not be imposed on the text.

    Code:
    Private Sub DrawButton(ByVal hWnd As Long, ByVal hDC As Long, Button As Object)
    .....
    If Not Button.Caption = vbNullString Or Len(Button.Caption) > 0 Then
        Set ButtonFont = Button.Font
        FontOld = SelectObject(hDC, ButtonFont.hFont)
        RectText = RectClient
        DrawText hDC, StrPtr(Button.Caption), -1, RectText, DT_CALCRECT Or DT_WORDBREAK
        RectText.Right = RectClient.Right
        If ButtonPic Is Nothing Then
            RectText.Left = RectClient.Left
            RectText.Top = ((RectClient.Bottom - RectText.Bottom) / 2) + 3
            RectText.Bottom = RectText.Top + RectText.Bottom
        Else
            RectText.Left = CInt(Button.Parent.ScaleX(ButtonPic.Width, vbHimetric, vbPixels)) + 4
            'RectText.Top = RectClient.Top '(RectClient.Bottom - RectText.Bottom) + 1
            RectText.Top = (((RectClient.Bottom - RectClient.Top) - (RectText.Bottom - RectText.Top)) / 2) + RectClient.Top
            RectText.Bottom = RectClient.Bottom
        End If
        DrawThemeText Theme, hDC, 1, ButtonState, StrPtr(Button.Caption), -1, DT_CENTER Or DT_WORDBREAK, 0, RectText
        SelectObject hDC, FontOld
    End If
    CloseThemeData Theme
    If Not ButtonPic Is Nothing Then
        W = CInt(Button.Parent.ScaleX(ButtonPic.Width, vbHimetric, vbPixels))
        H = CInt(Button.Parent.ScaleY(ButtonPic.Height, vbHimetric, vbPixels))
        If Not Button.Caption = vbNullString Or Len(Button.Caption) > 0 Then
            X = RectClient.Left
            'Y = RectClient.Top ' + ((RectClient.Bottom - RectClient.Left - H) / 2)
            Y = (((RectClient.Bottom - RectClient.Top) - H) / 2) + RectClient.Top
        Else
            RectClient.Bottom = RectText.Top
            X = RectClient.Left + ((RectClient.Right - RectClient.Left - W) / 2)
            Y = RectClient.Top + ((RectClient.Bottom - RectClient.Left - H) / 2)
        End If
        If Enabled = True Then
            If Button.UseMaskColor = True Then
                Call DrawTransparentPicture(ButtonPic, hDC, X, Y, W, H, WinColor(Button.MaskColor))
            Else
                ButtonPic.Render hDC, X, Y + H, W, -H, 0, 0, ButtonPic.Width, ButtonPic.Height, ByVal 0
            End If
        Else
            Call DrawDisabledPicture(ButtonPic, hDC, X, Y, W, H, WinColor(Button.MaskColor))
        End If
    End If

  40. #40
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: CommonControls (Replacement of the MS common controls)

    sleeeeeeeeeeeeeek

Page 1 of 62 12341151 ... LastLast

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