Page 89 of 95 FirstFirst ... 397986878889909192 ... LastLast
Results 3,521 to 3,560 of 3772

Thread: CommonControls (Replacement of the MS common controls)

  1. #3521
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,749

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Mith View Post
    I tested the grid line problem with the MS listview and i got the same results:

    Attachment 186880 Attachment 186881

    It looks like the devs just drawed the grid lines into the current cell space without extending the cell space for each drawed line.
    Another unsolved bug of the MS controls.
    Perhaps you can only modify your icon to add one or more columns of pixels to its left.

  2. #3522
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    322

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

    Quote Originally Posted by Nouyana View Post
    There is a run-time error #383 "Property is read-only" in the last line of the ComCtlsDemo(4/14/2023).RichTextBoxForm.Form_Load sub:

    Code:
    FontCombo1.Text = RichTextBox1.SelFontName
    Another error occurs here:

    Code:
    With New CommonDialog
       .HelpFile = sHelpFile ' = C:\\...\VBENLR98.CHM
       .HelpCommand = CdlHelpContext
       .HelpContext = nContextID     ' = 1000011
       .ShowHelp
    End With
    The error message:
    Code:
    ---------------------------
    Windows Help
    ---------------------------
    The C:\Program Files\Microsoft Visual Studio\MSDN\2001OCT\1033\VBENLR98.CHM file is not a Windows Help file, or the file is corrupted.
    ---------------------------
    ОК   
    ---------------------------
    It seems that the CommonDialog can't show any of VB6 CHM files.

    I've got the HelpFile from the Err.HelpFile and HelpContext from Err.HelpContext (division by zero)
    Last edited by Nouyana; May 20th, 2023 at 12:09 PM.

  3. #3523

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    There is a run-time error #383 "Property is read-only" in the last line of the ComCtlsDemo(4/14/2023).RichTextBoxForm.Form_Load sub:

    Code:
    FontCombo1.Text = RichTextBox1.SelFontName
    That error means that the FontCombo does not contain the FontName what is currently used in the RichTextBox control. Can you debug.print the RichTextBox1.SelFontName ?

  4. #3524
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    322

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    That error means that the FontCombo does not contain the FontName what is currently used in the RichTextBox control
    No, it means that FontCombo1.Style property is set to FtcStyleDropDownList.

  5. #3525
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,719

    Re: CommonControls (Replacement of the MS common controls)

    I haven't seen it mentioned here or in the changelog and haven't seen you around the tB Discord; so just wanted to relay a bug we had found that impacts VBCCR too: When the TreeView_NodeClick event fires, .SelectedItem is not up to date (it is for comctl32 and mscomctl TVs). So if you use .SelectedItem within your event handler, it won't be referring to the same item as the Node object.

  6. #3526
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Question Dark Mode - changing the ForeColor have no effect with some controls

    VBCCR v1.7.49
    Windows 10
    VB6SP6

    Im want to implement a dark mode for my app and change the backcolor and forecolor of all controls on a form.

    The problem starts with the controls CheckBoxW and OptionButtonW:

    I can set & change the backcolor but changing the ForeColor doesnt change the text color.

    Changing the forecolor of controls like LabelW or TextBoxW works fine.

    I know i can disable the use of the VisualStyles for these controls, but this is no solution.

    Does anyone know a solution to force CheckBoxW and OptionButtonW to use the new forecolor? Maybe via SendMessage?
    Or with a API call to rewrite the caption text using a new color?

  7. #3527
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: CommonControls (Replacement of the MS common controls)

    @Nouyana @Krool Both is true: when the item is not in the list and the style is set to FtcStyleDropDownList then you'll get the error - you have to add the new item before you may set it as text; when it is in the list already this entry becomes the selected one.

  8. #3528
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,749

    Re: CommonControls (Replacement of the MS common controls)

    The number of members cannot be obtained for VB6 class objects compiled into EXE.

    Other third-party OCX controls can be obtained by adding .OBJECT

    Code:
    Msgbox GetMethodCount(Class1A) '0
    Msgbox GetMethodCount(WebBrowser1) '0
    Msgbox GetMethodCount(Web) '19
    Msgbox GetMethodCount(WebBrowser1.Object) '19
    Msgbox GetMethodCount(WebBrowser1.Document) '379
    
    Msgbox "DataGrid1 METHOD=" & GetMethodCount(DataGrid1) '0
    Msgbox "DataGrid1.Object METHOD=" & GetMethodCount(DataGrid1.Object)  '111
    Code:
    Function GetMethodCount(Obj1 As Object) As Long
     Dim oITypeInfo As olelib.ITypeInfo, vAttrs As TYPEATTR, vTable As Long
     Dim oIDispatch As olelib.IDispatch, pAddress As Long, Fptr As Long
        Set oIDispatch = Obj1  ' get the IDispatch interface
      
       Set oITypeInfo = oIDispatch.GetTypeInfo(0, 0)
    
      'Msgbox oITypeInfo.GetFuncDesc(0)
      Dim fundisp As Long
      On Error GoTo err1
      'CallCOMInterface& ObjPtr(oITypeInfo), 6, 0&, VarPtr(fundisp)
      fundisp = oITypeInfo.GetFuncDesc(0)
     
     If fundisp <> 0 Then
       pAddress = oITypeInfo.GetTypeAttr
       CopyMemory vAttrs, ByVal pAddress, Len(vAttrs)  ' copy that structure
       oITypeInfo.ReleaseTypeAttr pAddress
       GetMethodCount = vAttrs.cFuncs
      End If
      Exit Function
    err1:
    End Function
    Last edited by xiaoyao; Jun 19th, 2023 at 08:00 AM.

  9. #3529
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,447

    Re: CommonControls (Replacement of the MS common controls)

    @Krool, is it possible to add a Lock (or Locked) property to all VBCCR controls? The Lock property is different from the Enabled property, and it is very useful in many cases.
    Last edited by SearchingDataOnly; Jun 24th, 2023 at 10:28 AM.

  10. #3530
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    TextBox Multiline Border Style Bug?

    VB6SP6, Win10 (latest), VBCCR 1.7.49

    @Krool

    I have a problem with the border draw of a multiline textbox with scrollbars=both and borderstyle=CCBorderStyleSingle.
    The border is only drawn around the text field and not including the visible scrollbars:

    Name:  TextBox Multiline CCBorderStyleSingle.png
Views: 800
Size:  5.2 KB

    VBCCR TextBox Multiline CCBorderStyleThin:

    Name:  TextBox Multiline CCBorderStyleThin.png
Views: 796
Size:  5.6 KB

    VBCCR TextBox Multiline CCBorderStyleSunken:

    Name:  TextBox Multiline CCBorderStyleSunken.png
Views: 783
Size:  4.8 KB

  11. #3531
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    322

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

    v1.7.0.55 (2023-05-17) doesn't work with "true" unicode. VBFlexGrid.CellToolTipText does work:

    Code:
    Private Sub Command1_Click()
       With VBFlexGrid1
          .Row = 1: .Col = 1
          .ShowInfoTips = True
          .CellToolTipText = "ABC " & ChrW$(-17827)
          CommandButtonW1.ToolTipText = "ABC " & ChrW$(-17827)
       End With
    End Sub
    Name:  ToolTipText.gif
Views: 761
Size:  8.3 KB

  12. #3532

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    v1.7.0.55 (2023-05-17) doesn't work with "true" unicode. VBFlexGrid.CellToolTipText does work:

    Code:
    Private Sub Command1_Click()
       With VBFlexGrid1
          .Row = 1: .Col = 1
          .ShowInfoTips = True
          .CellToolTipText = "ABC " & ChrW$(-17827)
          CommandButtonW1.ToolTipText = "ABC " & ChrW$(-17827)
       End With
    End Sub
    Name:  ToolTipText.gif
Views: 761
Size:  8.3 KB
    The control's ToolTipText property comes from VB.VBControlExtender and I have no influence about that. You can find kind of hacks which turn these to multiline-enable and unicode enable. (Here in vbForums)

  13. #3533
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,251

    Re: CommonControls (Replacement of the MS common controls)

    Question for Krool: Your imagelist. Do all the images contained within a single imageList have to be the same size? I notice that the width/height seems to inferred from the first image that is loaded into the list and that implies that they all need to be the same size from that point on.

    If this is the case, have you thought about adding an additional option to allow images of differing sizes to co-exist within the same imageList? It would be a useful storage structure if so.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  14. #3534

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by fafalone View Post
    I haven't seen it mentioned here or in the changelog and haven't seen you around the tB Discord; so just wanted to relay a bug we had found that impacts VBCCR too: When the TreeView_NodeClick event fires, .SelectedItem is not up to date (it is for comctl32 and mscomctl TVs). So if you use .SelectedItem within your event handler, it won't be referring to the same item as the Node object.
    It seems that MS treeview v5 behaves as you describe but the v6 behaves like VBCCR does... so there is a discrepancy already within MS treeview versions.

  15. #3535

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: TextBox Multiline Border Style Bug?

    Quote Originally Posted by Mith View Post
    VB6SP6, Win10 (latest), VBCCR 1.7.49

    @Krool

    I have a problem with the border draw of a multiline textbox with scrollbars=both and borderstyle=CCBorderStyleSingle.
    The border is only drawn around the text field and not including the visible scrollbars:

    Name:  TextBox Multiline CCBorderStyleSingle.png
Views: 800
Size:  5.2 KB

    VBCCR TextBox Multiline CCBorderStyleThin:

    Name:  TextBox Multiline CCBorderStyleThin.png
Views: 796
Size:  5.6 KB

    VBCCR TextBox Multiline CCBorderStyleSunken:

    Name:  TextBox Multiline CCBorderStyleSunken.png
Views: 783
Size:  4.8 KB
    Ok, this must be kind of a new "feature" by MS.

    It seems having WS_BORDER together with WS_HSCROLL and WS_VSCROLL at edit control creation causes this problem.
    I test it by not adding WS_BORDER at creation but change later on, which worked. Will fix it soon.. thanks

    Quote Originally Posted by yereverluvinuncleber View Post
    Question for Krool: Your imagelist. Do all the images contained within a single imageList have to be the same size? I notice that the width/height seems to inferred from the first image that is loaded into the list and that implies that they all need to be the same size from that point on.

    If this is the case, have you thought about adding an additional option to allow images of differing sizes to co-exist within the same imageList? It would be a useful storage structure if so.
    No, the height/width must be specified on ImageList_Create, so it cannot contain multiple images with different sizes.

    Quote Originally Posted by SearchingDataOnly View Post
    @Krool, is it possible to add a Lock (or Locked) property to all VBCCR controls? The Lock property is different from the Enabled property, and it is very useful in many cases.
    For a TextBox control it's clear what Locked vs Enabled means. But for other controls it's more difficult. Let's say a Slider control. How different can a Locked be vs Enabled ?

    Quote Originally Posted by Nouyana View Post
    Another error occurs here:

    Code:
    With New CommonDialog
       .HelpFile = sHelpFile ' = C:\\...\VBENLR98.CHM
       .HelpCommand = CdlHelpContext
       .HelpContext = nContextID     ' = 1000011
       .ShowHelp
    End With
    The error message:
    Code:
    ---------------------------
    Windows Help
    ---------------------------
    The C:\Program Files\Microsoft Visual Studio\MSDN\2001OCT\1033\VBENLR98.CHM file is not a Windows Help file, or the file is corrupted.
    ---------------------------
    ОК   
    ---------------------------
    It seems that the CommonDialog can't show any of VB6 CHM files.

    I've got the HelpFile from the Err.HelpFile and HelpContext from Err.HelpContext (division by zero)
    The CommonDialog.ShowHelp (WinHelpW function) works not on CHM files.

    The WinHelp system used HLP files; the newer HTMLHelp system used CHM files
    Last edited by Krool; Jun 29th, 2023 at 01:06 AM.

  16. #3536
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    322

    Re: TextBox Multiline Border Style Bug?

    Quote Originally Posted by Krool View Post
    The CommonDialog.ShowHelp (WinHelpW function) works not on CHM files.
    Can you add this feature? CHM files are wildly used unlike HLP.

  17. #3537
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    CommandButtonW vertical alignment bug

    VB6SP6, Win10 (latest), VBCCR 1.7.49

    @Krool

    I try to vertical align a character in the CommandButtonW control and it looks like the VerticalAlignment property is buggy:

    Name:  Button Vertical Alignment.png
Views: 602
Size:  3.2 KB

    1. Button: CCVerticalAlignmentTop
    2. Button: CCVerticalAlignmentCenter
    3. Button: CCVerticalAlignmentBottom

    CCVerticalAlignmentTop = the character is displayed at the bottom and outside of the control
    CCVerticalAlignmentCenter = the character is not displayed in the center
    CCVerticalAlignmentBottom= the character is displayed at the top

    The internal calculation for top/bottom align is swapped and the calculation for center & bottom align is not correct too.

    It seems like the calculation doesnt respect the font size & style (e.g. bold). The used font size on the screenshot above is 24/bold.

    Can you fix this?


    1. Button properties:

    Name:  Button properties.png
Views: 564
Size:  216.1 KB

  18. #3538
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    322

    Re: CommandButtonW vertical alignment bug

    Quote Originally Posted by Mith View Post
    I try to vertical align a character in the CommandButtonW control and it looks like the VerticalAlignment property is buggy:

    Name:  Button Vertical Alignment.png
Views: 602
Size:  3.2 KB
    Did you compare it with the standard CommandButton?

  19. #3539

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: CommandButtonW vertical alignment bug

    Quote Originally Posted by Mith View Post
    VB6SP6, Win10 (latest), VBCCR 1.7.49

    @Krool

    I try to vertical align a character in the CommandButtonW control and it looks like the VerticalAlignment property is buggy:

    Name:  Button Vertical Alignment.png
Views: 602
Size:  3.2 KB

    1. Button: CCVerticalAlignmentTop
    2. Button: CCVerticalAlignmentCenter
    3. Button: CCVerticalAlignmentBottom

    CCVerticalAlignmentTop = the character is displayed at the bottom and outside of the control
    CCVerticalAlignmentCenter = the character is not displayed in the center
    CCVerticalAlignmentBottom= the character is displayed at the top

    The internal calculation for top/bottom align is swapped and the calculation for center & bottom align is not correct too.

    It seems like the calculation doesnt respect the font size & style (e.g. bold). The used font size on the screenshot above is 24/bold.

    Can you fix this?


    1. Button properties:
    I use here BS_TOP/BS_VCENTER/BS_BOTTOM. And if the button's height is enough the vertical alignment looks correct.
    I think what MS does here it tries to align but snaps back to button's boundary. That's why it looks "reversed" for a big Font and small button.

  20. #3540
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Re: CommandButtonW vertical alignment bug

    Quote Originally Posted by Krool View Post
    I use here BS_TOP/BS_VCENTER/BS_BOTTOM. And if the button's height is enough the vertical alignment looks correct.
    I think what MS does here it tries to align but snaps back to button's boundary. That's why it looks "reversed" for a big Font and small button.
    How about using the API GetTextExtentPoint32 to determine the real height of the current caption text and then calculate the correct position using the button boundaries?

    Here is some code to do this:

    Code:
    Private Type SIZE
      Width As Long
      Height As Long
    End Type
    
    Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
    End Type
    
    Private Declare Function GetTextExtentPoint32 Lib "gdi32" _
     Alias "GetTextExtentPoint32A" (ByVal hDC As Long, _
     ByVal lpsz As String, ByVal cbString As Long, lpSize As SIZE) _
     As Long
    
    Public Declare Function SendMessageAny Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    
    Dim nSize As SIZE
    dim sCaption as String
    dim cHDC as long
    Dim cRECT As RECT
    dim cHeight as long 
    Dim cHWND as long
    dim lTextHeight as long 
    dim lCenterStartPos as long 
    dim lTopStartPos as long 
    dim lBottomStartPos as long 
    
    sCaption = commandbutton.caption
    cHDC  = commandbuttonw.hDC
    cHWND = commandbuttonw.hWnd
    
    ' get the Caption text height
    GetTextExtentPoint32 cHDC, sCaption, Len(sCaption), nSize
    lTextHeight = nSize.Height
    
    ' get the button sizes
    SendMessageAny cHWND , EM_GETRECT, 0, cRECT 
    cHeight = cRECT.Bottom - cRECT.Top
    
    ' correct center position:
    
    lCenterStartPos = (cHeight - lTextHeight) / 2
    
    ' correct top position:
    
    lTopStartPos  = cRECT.Top
    
    ' correct bottom position
    
    lBottomStartPos = cRECT.Bottom - lTextHeight

  21. #3541

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: TextBox Multiline Border Style Bug?

    Quote Originally Posted by Mith View Post
    VB6SP6, Win10 (latest), VBCCR 1.7.49

    @Krool

    I have a problem with the border draw of a multiline textbox with scrollbars=both and borderstyle=CCBorderStyleSingle.
    The border is only drawn around the text field and not including the visible scrollbars:

    Name:  TextBox Multiline CCBorderStyleSingle.png
Views: 800
Size:  5.2 KB

    VBCCR TextBox Multiline CCBorderStyleThin:

    Name:  TextBox Multiline CCBorderStyleThin.png
Views: 796
Size:  5.6 KB

    VBCCR TextBox Multiline CCBorderStyleSunken:

    Name:  TextBox Multiline CCBorderStyleSunken.png
Views: 783
Size:  4.8 KB
    Concerning this the VB.TextBox has the same issue. So this is a "new" MS bug.

    VB.TextBox Appearance must be set to 0 - Flat.

    Name:  TextBoxBorderBug.png
Views: 679
Size:  2.5 KB

  22. #3542
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,251

    Re: TextBox Multiline Border Style Bug?

    Quote Originally Posted by Krool View Post
    No, the height/width must be specified on ImageList_Create, so it cannot contain multiple images with different sizes.
    Understood, thankyou. That just solves a thought of mine as to how to store a variety of images of different sizes. I will have to use another method.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  23. #3543
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    small bug at the ScrollBar control

    VB6SP6, Win10 (latest), VBCCR 1.7.49

    @Krool

    i found a small bug using the ProgressBar in the IDE:

    the displayed text in the ProgressBar is not redrawed when changing the font.
    I have to change the text property to force a redraw with the new font settings.

    Nothing critical but i guess easy to fix ;-)

  24. #3544

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: small bug at the ScrollBar control

    Quote Originally Posted by Mith View Post
    VB6SP6, Win10 (latest), VBCCR 1.7.49

    @Krool

    i found a small bug using the ProgressBar in the IDE:

    the displayed text in the ProgressBar is not redrawed when changing the font.
    I have to change the text property to force a redraw with the new font settings.

    Nothing critical but i guess easy to fix ;-)
    Done. Thanks

  25. #3545

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    I modified OLEGuids.tlb and VTableHandle.bas once again. (VTableHandle.bas is now x64 aware)
    All LPSTR and LPWSTR got replaced to LONG StrPtr() so that the VB6 code base will be the same when transition to twinBASIC. (x86 or x64)
    In x64 we cannot re-compile OLEGuids.odl as MIDL does not allow it. So it must be done via twinBASIC Package (OLEGuids.twin) which works great but does not support LPSTR and LPWSTR.. That's why it needed to be replaced to LONG in OLEGuids.tlb that in twinBASIC we can define LongPtr in the OLEGuids.twin package.

    Sorry for the inconvenience caused.

  26. #3546

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Fixed const FR_HIDEMATCHCASE from &H8000 into &H8000&.

    Thanks to NBechtloff who made it possible to modify the type lib in VBCCR17.OCX so it could be re-compiled with "binary compatibility".

  27. #3547
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Question ImageCombo missing backcolor/forecolor property

    @Krool

    The ComboBoxW does have a BackColor & ForeColor property to change the text display of the dropdown list but the ImageCombo control doesnt have them.
    Have you forgotten to add these properties or is there another reason why they dont exist?
    Do you have any idea how to change the BackColor & ForeColor property of the ImageCombo control?

  28. #3548

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: ImageCombo missing backcolor/forecolor property

    Quote Originally Posted by Mith View Post
    @Krool

    The ComboBoxW does have a BackColor & ForeColor property to change the text display of the dropdown list but the ImageCombo control doesnt have them.
    Have you forgotten to add these properties or is there another reason why they dont exist?
    Do you have any idea how to change the BackColor & ForeColor property of the ImageCombo control?
    You can't change them in ImageCombo.

    The ImageCombo is basically a super-classed ComboBox.
    The items are owner-drawn by MS and they hard-coded the fore color and background color.
    So I guess through hacks and API redirection it's possible but that should be done by the app and not by a OCX.

  29. #3549
    Member
    Join Date
    Feb 2023
    Posts
    32

    VBCCR17: Runtime error -2147221164

    At one machine I get this error:
    VBCCR17:
    Run-time error -2147221164 (80040154)

    What could that be?
    Any idea how to solve this?

    This occurs in the _Initialize routine of an user control, with VBCCR17.LabelWs, VBCCR17.CommandButtonWs and one VBCCR17.TreeView, VB.Images

  30. #3550
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Re: VBCCR17: Runtime error -2147221164

    Quote Originally Posted by Chris_G33 View Post
    At one machine I get this error:
    VBCCR17:
    Run-time error -2147221164 (80040154)
    On which version of Windows does the error occur?

  31. #3551
    Member
    Join Date
    Feb 2023
    Posts
    32

    Re: VBCCR17: Runtime error -2147221164

    Quote Originally Posted by Mith View Post
    On which version of Windows does the error occur?
    Windows 11 22H2, x64 german.
    Last edited by Chris_G33; Jul 17th, 2023 at 12:56 PM.

  32. #3552
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Re: CommonControls (Replacement of the MS common controls)

    @Chris_G33

    Search this thread for "-2147221164" and you will see i had the same problem with the older version of VBCCR1.6.
    I used the OCX with SxS (Side-by-Side) but i had to manually registering the OCX on the system to fix this error.

  33. #3553
    Member
    Join Date
    Feb 2023
    Posts
    32

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Mith View Post
    @Chris_G33

    Search this thread for "-2147221164" and you will see i had the same problem with the older version of VBCCR1.6.
    I used the OCX with SxS (Side-by-Side) but i had to manually registering the OCX on the system to fix this error.
    Thanks a lot. That solved it!

  34. #3554
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Re: CommonControls (Replacement of the MS common controls)

    @Krool

    Im working on a Dark Mode for the VBCCR controls, see https://www.vbforums.com/showthread....e-amp-VB6-apps

    The themed CheckBox and the Option control doesnt support the change of the forecolor so i started to ownerdraw the controls.
    Currently i draw the checkbox symbol themed and the text with the control forecolor.
    However, I have a problem with hottracking (moving the mouse over the checkbox) because this does not trigger the OwnerDraw event and therefore the checkbox cannot be drawn with CBS_UNCHECKEDHOT/CBS_CHECKEDHOT.
    Can you change this and trigger the OwnerDraw event when a mouse hottracking occurs?

    Another general problem with owner draw controls is that they are invisible in the IDE and you lose track of the controls on a form. Could this be changed somehow so that the owner draw controls are still displayed normally in the IDE?

    IDE:
    Name:  Checkboxes IDE.png
Views: 412
Size:  2.5 KB

    Started App:
    Name:  Checkboxes App.png
Views: 417
Size:  3.6 KB

    Dark Mode:
    Name:  Checkboxes App Dark Mode.png
Views: 420
Size:  3.5 KB

  35. #3555
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Re: CommonControls (Replacement of the MS common controls)

    @Krool

    Quote Originally Posted by Mith View Post
    However, I have a problem with hottracking (moving the mouse over the checkbox) because this does not trigger the OwnerDraw event and therefore the checkbox cannot be drawn with CBS_UNCHECKEDHOT/CBS_CHECKEDHOT.
    Can you change this and trigger the OwnerDraw event when a mouse hottracking occurs?
    MS doesnt send the state ODS_HOTLIGHT when the mouse enters, moves or leaves the control.
    A solution is to trigger the ownerdraw event at the current existing events "MouseEnter" and MouseLeave" to redraw the checkbox with CBS_UNCHECKEDHOT/CBS_CHECKEDHOT and the option control with RBS_UNCHECKEDHOT/RBS_CHECKEDHOT.
    Please can you add this with the next update for the checkbox and optionbutton control?

    Name:  checkbox hot.png
Views: 377
Size:  4.6 KBName:  checkbox ownerdraw hot.png
Views: 371
Size:  4.2 KB

    Name:  option button hot.png
Views: 374
Size:  5.8 KBName:  option button ownerdraw hot.png
Views: 374
Size:  5.1 KB

  36. #3556

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Mith View Post
    @Krool



    MS doesnt send the state ODS_HOTLIGHT when the mouse enters, moves or leaves the control.
    A solution is to trigger the ownerdraw event at the current existing events "MouseEnter" and MouseLeave" to redraw the checkbox with CBS_UNCHECKEDHOT/CBS_CHECKEDHOT and the option control with RBS_UNCHECKEDHOT/RBS_CHECKEDHOT.
    Please can you add this with the next update for the checkbox and optionbutton control?

    Name:  checkbox hot.png
Views: 377
Size:  4.6 KBName:  checkbox ownerdraw hot.png
Views: 371
Size:  4.2 KB

    Name:  option button hot.png
Views: 374
Size:  5.8 KBName:  option button ownerdraw hot.png
Views: 374
Size:  5.1 KB
    You can call an .Refresh within MouseEnter/MouseLeave.
    That's a good scenario where the app should invoke a redraw, IMO.

  37. #3557
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    You can call an .Refresh within MouseEnter/MouseLeave.
    That's a good scenario where the app should invoke a redraw, IMO.
    Sorry, .Refresh within MouseEnter/MouseLeave doesnt trigger the OwnerDraw event and i guess it would not set the state to ODS_HOTLIGHT to draw the highlighted checkbox.

    A solution would be to extend the OwnerDraw event parameters with "byval MouseEnter as boolean = false" and "byval MouseLeave as boolean = false" to simulate the control state ODS_HOTLIGHT. You could trigger the OwnerDraw event after "RaiseEvent MouseEnter" and "RaiseEvent MouseLeave" in the code. But im not sure how you get the necessary information for the other OwnerDraw event parameters at this point...

  38. #3558

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,395

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Mith View Post
    Sorry, .Refresh within MouseEnter/MouseLeave doesnt trigger the OwnerDraw event and i guess it would not set the state to ODS_HOTLIGHT to draw the highlighted checkbox.

    A solution would be to extend the OwnerDraw event parameters with "byval MouseEnter as boolean = false" and "byval MouseLeave as boolean = false" to simulate the control state ODS_HOTLIGHT. You could trigger the OwnerDraw event after "RaiseEvent MouseEnter" and "RaiseEvent MouseLeave" in the code. But im not sure how you get the necessary information for the other OwnerDraw event parameters at this point...
    We don't need WM_DRAWITEM to include ODS_HOTLIGHT.
    Since I already have a "MouseOver" state I could simply add that state when passing to the OwnerDraw event.
    What I don't understand is your point that a .Refresh upon MouseEnter will not trigger an OwnerDraw.
    Anyway, I could add an invalidation on that one automatically in the step when adding ODS_HOTLIGHT also.
    Give me little bit time until it's added.

  39. #3559
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    We don't need WM_DRAWITEM to include ODS_HOTLIGHT.
    Since I already have a "MouseOver" state I could simply add that state when passing to the OwnerDraw event.
    What I don't understand is your point that a .Refresh upon MouseEnter will not trigger an OwnerDraw.
    Anyway, I could add an invalidation on that one automatically in the step when adding ODS_HOTLIGHT also.
    Give me little bit time until it's added.
    If we only use "MouseOver" and the user moves the mouse pointer outside the control how can the control be updated and redrawn with the normal checkbox?
    Using "MouseEnter" will ensure to draw the "hot-checkbox" and MouseLeave will ensure to draw the normal checkbox again.

  40. #3560
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    450

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    What I don't understand is your point that a .Refresh upon MouseEnter will not trigger an OwnerDraw.
    My code:

    Code:
    Private Sub chkOwnerdraw_MouseEnter()
    chkOwnerdraw.Refresh
    End Sub
    
    Private Sub chkOwnerdraw_MouseLeave()
    chkOwnerdraw.Refresh
    End Sub
    
    Private Sub chkOwnerdraw_OwnerDraw(ByVal Action As Long, ByVal State As Long, ByVal hDC As Long, ByVal Left As Long, ByVal Top As Long, ByVal Right As Long, ByVal Bottom As Long)
    Call OwnerDraw_CheckBox(chkOwnerdraw, Action, State, hDC, Left, Top, Right, Bottom)
    End Sub
    a .Refresh doesnt call the OwnerDraw sub.

Page 89 of 95 FirstFirst ... 397986878889909192 ... 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
  •  



Click Here to Expand Forum to Full Width