-
May 19th, 2023, 12:48 PM
#3521
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Mith
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.
-
May 20th, 2023, 12:03 PM
#3522
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Nouyana
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.
-
May 31st, 2023, 02:43 PM
#3523
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Nouyana
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 ?
-
May 31st, 2023, 03:57 PM
#3524
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
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.
-
May 31st, 2023, 07:21 PM
#3525
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.
-
Jun 18th, 2023, 09:32 PM
#3526
Hyperactive Member
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?
-
Jun 19th, 2023, 03:02 AM
#3527
Member
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.
-
Jun 19th, 2023, 07:57 AM
#3528
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.
-
Jun 24th, 2023, 10:23 AM
#3529
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.
-
Jun 26th, 2023, 03:01 AM
#3530
Hyperactive Member
-
Jun 27th, 2023, 08:19 AM
#3531
Addicted Member
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
-
Jun 27th, 2023, 11:29 AM
#3532
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Nouyana
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

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)
-
Jun 27th, 2023, 01:14 PM
#3533
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.
PS. At this point in the conversation, Niya would normally appear.
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.
-
Jun 28th, 2023, 04:26 AM
#3534
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by fafalone
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.
-
Jun 29th, 2023, 01:00 AM
#3535
Re: TextBox Multiline Border Style Bug?
 Originally Posted by Mith
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:
VBCCR TextBox Multiline CCBorderStyleThin:
VBCCR TextBox Multiline CCBorderStyleSunken:

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
 Originally Posted by yereverluvinuncleber
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.
 Originally Posted by SearchingDataOnly
@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 ?
 Originally Posted by Nouyana
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.
-
Jun 29th, 2023, 05:19 AM
#3536
Addicted Member
Re: TextBox Multiline Border Style Bug?
 Originally Posted by Krool
The CommonDialog.ShowHelp (WinHelpW function) works not on CHM files.
Can you add this feature? CHM files are wildly used unlike HLP.
-
Jun 29th, 2023, 09:34 AM
#3537
-
Jun 29th, 2023, 10:42 AM
#3538
Addicted Member
Re: CommandButtonW vertical alignment bug
 Originally Posted by Mith
I try to vertical align a character in the CommandButtonW control and it looks like the VerticalAlignment property is buggy:

Did you compare it with the standard CommandButton?
-
Jun 29th, 2023, 12:46 PM
#3539
Re: CommandButtonW vertical alignment bug
 Originally Posted by Mith
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:
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.
-
Jun 29th, 2023, 08:18 PM
#3540
Hyperactive Member
Re: CommandButtonW vertical alignment bug
 Originally Posted by Krool
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
-
Jun 30th, 2023, 01:36 AM
#3541
Re: TextBox Multiline Border Style Bug?
 Originally Posted by Mith
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:
VBCCR TextBox Multiline CCBorderStyleThin:
VBCCR TextBox Multiline CCBorderStyleSunken:

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.
-
Jul 1st, 2023, 10:03 AM
#3542
Re: TextBox Multiline Border Style Bug?
 Originally Posted by Krool
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.
PS. At this point in the conversation, Niya would normally appear.
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.
-
Jul 5th, 2023, 10:44 PM
#3543
Hyperactive Member
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 ;-)
-
Jul 6th, 2023, 02:32 PM
#3544
Re: small bug at the ScrollBar control
 Originally Posted by Mith
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
-
Jul 7th, 2023, 10:08 AM
#3545
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.
-
Jul 8th, 2023, 06:00 AM
#3546
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".
-
Jul 13th, 2023, 10:40 AM
#3547
Hyperactive Member
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?
-
Jul 13th, 2023, 10:45 AM
#3548
Re: ImageCombo missing backcolor/forecolor property
 Originally Posted by Mith
@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.
-
Jul 17th, 2023, 08:55 AM
#3549
Junior Member
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
-
Jul 17th, 2023, 09:55 AM
#3550
Hyperactive Member
Re: VBCCR17: Runtime error -2147221164
 Originally Posted by Chris_G33
At one machine I get this error:
VBCCR17:
Run-time error -2147221164 (80040154)
On which version of Windows does the error occur?
-
Jul 17th, 2023, 12:30 PM
#3551
Junior Member
Re: VBCCR17: Runtime error -2147221164
 Originally Posted by Mith
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.
-
Jul 17th, 2023, 03:00 PM
#3552
Hyperactive Member
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.
-
Jul 18th, 2023, 03:55 AM
#3553
Junior Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Mith
@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!
-
Jul 21st, 2023, 04:33 AM
#3554
Hyperactive Member
-
Jul 24th, 2023, 07:55 PM
#3555
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
-
Jul 24th, 2023, 10:31 PM
#3556
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Mith
@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?

 
You can call an .Refresh within MouseEnter/MouseLeave.
That's a good scenario where the app should invoke a redraw, IMO.
-
Jul 25th, 2023, 12:02 AM
#3557
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
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...
-
Jul 25th, 2023, 01:52 AM
#3558
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Mith
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.
-
Jul 25th, 2023, 03:23 AM
#3559
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
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.
-
Jul 25th, 2023, 03:27 AM
#3560
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|