-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
TomasEss
Hi
My project has used VBCCR11.OCX successfully :-) for a long time. Now I thought I would upgrade to 17.
My DTPicker controls now no longer have the ShowCalendar method. Is this intentional? I have not found anything about it in this thread.
Am I supposed to be able to programmatically show it some other way?
It must be replaced by the .DroppedDown property (get/let).
-
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Krool
please could you tell why labelws and CommandButtonWs are showing Arabic language like this:
Attachment 183606
thanks
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
samer22
please could you tell why labelws and CommandButtonWs are showing Arabic language like this:
I cant reproduce this problem here using Window 7 with VBCCR1.7:
Attachment 183611
All controls use the standard font "MS Sans Serif".
MAybe your problem has something to do with your windows unicode settings for non-unicode programs.
From my experience i can tell you that this windows setting can screw up the unicode display of vb apps.
-
Re: CommonControls (Replacement of the MS common controls)
thanks Mith for your interest
Could you try format "Arab Egypt " and location "Egypt" in regional settings.
I'm using Window 7 with VBCCR1.7 too
-
Re: CommonControls (Replacement of the MS common controls)
It's recommended to use the better Microsoft Sans Serif font instead of MS Sans Serif.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
It's recommended to use the better Microsoft Sans Serif font instead of MS Sans Serif.
thanks but still no luck
Same issue with VbFlexgrid
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
samer22
Could you try format "Arab Egypt " and location "Egypt" in regional settings.
I work with a german Windows version. You should try another format and location because i dont have any problems here :)
-
Re: CommonControls (Replacement of the MS common controls)
how does the CommandButtonW.ImageList work with Picture DisabledPicture and DownPicture?
do i need a separate ImageList for each CommandButtonW/Picture-type
also i noticed that the MaskColor/UseMaskColor don't work when using picture without ImageList
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Semke
how does the CommandButtonW.ImageList work with Picture DisabledPicture and DownPicture?
do i need a separate ImageList for each CommandButtonW/Picture-type
also i noticed that the MaskColor/UseMaskColor don't work when using picture without ImageList
MaskColor is only applicable for Style = 1 Graphical.
Same with DownPicture and DisabledPicture.
For Style = 0 Normal you can either use Picture or ImageList.
Code:
' The image list should contain either a single image to be used for all states or
' individual images for each state. The following states are defined as following:
' PBS_NORMAL = 1
' PBS_HOT = 2
' PBS_PRESSED = 3
' PBS_DISABLED = 4
' PBS_DEFAULTED = 5
' PBS_STYLUSHOT = 6
-
Re: CommonControls (Replacement of the MS common controls)
Hey Krool - I swear I saw somewhere a discussion on adding the ability for png files but I cant find it. Can you point me in the right direction?
Edited - I think I found it. It was a convo between you and Trick. I guess it still isn't supported.
-
Re: CommonControls (Replacement of the MS common controls)
Hello,
I'm using the VBCCR16.OCX and I want to upgrade to VBCCR17.OCX but the VisualStyles.bas of the VBCCR17 doesn't include the SetupVisualStyles function or the InitVisualStyles.
With the VBCCR16, I had on the top of each form "SetupVisualStyles(me)", isn't this necessary anymore?
Thanks
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
PauloFranc
Hello,
I'm using the VBCCR16.OCX and I want to upgrade to VBCCR17.OCX but the VisualStyles.bas of the VBCCR17 doesn't include the SetupVisualStyles function or the InitVisualStyles.
With the VBCCR16, I had on the top of each form "SetupVisualStyles(me)", isn't this necessary anymore?
Thanks
You shall take VisualStyles.bas from the demo in post #1 of this thread.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
You shall take VisualStyles.bas from the demo in post #1 of this thread.
Thanks for the reply and thanks a lot for you work :)
-
Re: CommonControls (Replacement of the MS common controls)
Hello Krool, I'm using the latest compiled version of the ocx (VBCCR17.OCX), and I'm seeing some issues regarding the CheckBoxW:
1) I find no way to disable the focus rect.
I'm using Windows 11 with visual styles enabled (I guess Windows 10 must be the same) and the original VB CheckBox does not show the focus rect when visual styles are enabled.
2) The property "Custom" that is supposed to display the property pages seems to just change the Value property.
3) The property Transparent does not work at design time, but that is probably by design.
PS: I didn't go to check the control's source code.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Eduardo-
Hello Krool, I'm using the latest compiled version of the ocx (VBCCR17.OCX), and I'm seeing some issues regarding the CheckBoxW:
1) I find no way to disable the focus rect.
I'm using Windows 11 with visual styles enabled (I guess Windows 10 must be the same) and the original VB CheckBox does not show the focus rect when visual styles are enabled.
2) The property "Custom" that is supposed to display the property pages seems to just change the Value property.
3) The property Transparent does not work at design time, but that is probably by design.
PS: I didn't go to check the control's source code.
Hi Eduardo,
1) When an app is themed it has no focus rect but it will show focus rects once you use the tab key once on a window. However, this does not work in VB6. That's why the focus rect are forced in the CheckBoxW control via WM_UPDATEUISTATE. Also the VisualStyles.bas uses WM_UPDATEUISTATE on the SetupVisualStyles method for the whole form.
If you have another approach in mind please let me know or discuss it.
2) The Value property is the default property. The CheckBoxW has no property page, that's why the "Custom" is falling back to the Value property.
3) Yes that's ignored at design time. The property description also tells this.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Hi Eduardo,
1) When an app is themed it has no focus rect but it will show focus rects once you use the tab key once on a window. However, this does not work in VB6. That's why the focus rect are forced in the CheckBoxW control via WM_UPDATEUISTATE. Also the VisualStyles.bas uses WM_UPDATEUISTATE on the SetupVisualStyles method for the whole form.
If you have another approach in mind please let me know or discuss it.
I would have to study what you are saying.
I just wanted to put some CheckBoxes with no caption, and I got this:
Attachment 183855
For now I solved it by making the CheckBoxes narrower enough.
Quote:
Originally Posted by
Krool
2) The Value property is the default property. The CheckBoxW has no property page, that's why the "Custom" is falling back to the Value property.
When an UserControl has no property page, the "Custom" property does not appear at the property page.
I checked and the CheckBoxW has defined three property pages:
StandardFont
StandardColor
StandardPicture
The problem seems to be the call:
Code:
Call SetVTableHandling(Me, VTableInterfacePerPropertyBrowsing)
At UserControl_Initialize.
I think one solution might be to call it at UserControl_InitProperties and UserControl_ReadProperties but only when Ambient.UserMode is False.
Quote:
Originally Posted by
Krool
3) Yes that's ignored at design time. The property description also tells this.
OK.
Thanks :thumb:
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Eduardo-
When an UserControl has no property page, the "Custom" property does not appear at the property page.
I checked and the CheckBoxW has defined three property pages:
StandardFont
StandardColor
StandardPicture
The problem seems to be the call:
Code:
Call SetVTableHandling(Me, VTableInterfacePerPropertyBrowsing)
At UserControl_Initialize.
I think one solution might be to call it at UserControl_InitProperties and UserControl_ReadProperties but only when Ambient.UserMode is False.
I found out the reason. The (Custom) item raises IPerPropertyBrowsingVB::GetPredefinedStrings with an DispID of 0.
But since the Value property is the default property it also has a DispID of 0... (const DISPID_VALUE; 0)
So, it's unfortunate but I think it can be only fixed by using an Enum (As Long) instead of having the property As Integer currently.
But that would break VBCCR17 compatibility. So it's unlikely to be changed. And it's anyway just a minor glitch as there is no real property page behind anyway.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
I found out the reason. The (Custom) item raises IPerPropertyBrowsingVB::GetPredefinedStrings with an DispID of 0.
But since the Value property is the default property it also has a DispID of 0... (const DISPID_VALUE; 0)
So, it's unfortunate but I think it can be only fixed by using an Enum (As Long) instead of having the property As Integer currently.
But that would break VBCCR17 compatibility. So it's unlikely to be changed. And it's anyway just a minor glitch as there is no real property page behind anyway.
IDK what that call does, I mean Call SetVTableHandling(Me, VTableInterfacePerPropertyBrowsing)
What is the purpose?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Eduardo-
IDK what that call does, I mean Call SetVTableHandling(Me, VTableInterfacePerPropertyBrowsing)
What is the purpose?
For example to list all ImageLists available etc. in a property
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
For example to list all ImageLists available etc. in a property
Ah, OK. Then my suggestion of calling it only at runtime made no sense.
-
Re: CommonControls (Replacement of the MS common controls)
Does anyone know how to set listview ColumnHeaders width?
Code:
ListView1.ColumnHeaders(1).Width = 200
this code is throwing error
-
Re: CommonControls (Replacement of the MS common controls)
What's the error number & message?
-
Re: CommonControls (Replacement of the MS common controls)
I tried this and it worked as expected without error:
Code:
Option Explicit
Private Sub Form_Click()
Me.ListView1.ColumnHeaders(1).Width = 10000
End Sub
Private Sub Form_Load()
Me.ListView1.ColumnHeaders.Add , , "A"
Me.ListView1.ColumnHeaders.Add , , "B"
Me.ListView1.ColumnHeaders.Add , , "C"
Me.ListView1.View = LvwViewReport
End Sub
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
jpbro
What's the error number & message?
incorrect argument
Are you using Krool's listview?
Anyway i figured out how to do that
Code:
ListView1.ColumnHeaders.Add , , "Name", 2000, LvwColumnHeaderAlignmentLeft
ListView1.ColumnHeaders.Add , , "Symbol", 1200, LvwColumnHeaderAlignmentCenter
thank you
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mustaphi
Are you using Krool's listview?
Yes, I tried it with v1.7 of the OCX version of Krool's controls and there was no problem. Maybe you are using a different version?
-
Re: CommonControls (Replacement of the MS common controls)
Hi,
I have the sub main call the main form of the application, an MDI frm, but it doesn't even show the form giving "Run-time error 440: Automation error"
My problem is that this only happens on some PCs, one of them has Windows 7 and I found out that reducing the colour depth it stopped giving this problem. But I am now trying to run it on a Windows Server 2003 and can't get it to work.
Does anyone have any ideas about what can be happening?
Thanks
-
Re: CommonControls (Replacement of the MS common controls)
Found it... I have a toolbar linked to imagelists with the icons I need. The last two icons had a colour depth bigger than the others and older PCs couldn't cope with that.
Since the automation error was being shown in a window with VBCCR17 in the title, I never thought that could be the problem.
-
Re: CommonControls (Replacement of the MS common controls)
Hello Krool, thanks making and maintaining these controls! I have two questions/issues; apologies if these have been covered.
ComboBoxW - is there a reason that the Text property isn't the default?
MonthView - the latest version is better than the 1.5 version I was using previously, but when setting VisualStyles = False, the runtime size is still not quite the same size as the design-time size. Testing at normal DPI, font = Arial Regular 10.
Thanks!
Dan
-
Re: CommonControls (Replacement of the MS common controls)
One more:
MonthView - DateDblClick
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
hausman
ComboBoxW - is there a reason that the Text property isn't the default?
MonthView - the latest version is better than the 1.5 version I was using previously, but when setting VisualStyles = False, the runtime size is still not quite the same size as the design-time size. Testing at normal DPI, font = Arial Regular 10.
ComboBoxW - That's a bug! The VB.ComboBox has a hidden [_Default] property that redirects to the Text property. The VB.Label has the same logic and the LabelW control considered that but unfortunately not for the ComboBox...
Will look to fix that, hopefully possible for VBCCR17 without breaking.
MonthView - maybe the IDE is not manifest and links to comctl. 5.8x and the compiled executable has a manifest and is linked to comctl. 6.x. (even if both are not themed [VisualStyles = False] the controls are different)
What you mean with DateDblClick ? Please more context on that one.
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
Included the GetTextRange function in the RichTextBox control.
Included [_Default] property in ComboBoxW/FontCombo/VirtualCombo/ImageCombo.
The MS ImageCombo doesn't have a default property, but I think it is of no harm to make the .Text property as the default member there as well.
The OCX VBCCR17 was also updated. The internal type lib version is now 1.2.
Code:
Object={7020C36F-09FC-41FE-B822-CDE6FBB321EB}#1.2#0; VBCCR17.OCX
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
ComboBoxW - That's a bug! The VB.ComboBox has a hidden [_Default] property that redirects to the Text property. The VB.Label has the same logic and the LabelW control considered that but unfortunately not for the ComboBox...
Will look to fix that, hopefully possible for VBCCR17 without breaking.
FYI, I had changed the Attribute Text.VB_UserMemId = 0 to accomplish this. Not sure which method is best.
Quote:
Originally Posted by
Krool
MonthView - maybe the IDE is not manifest and links to comctl. 5.8x and the compiled executable has a manifest and is linked to comctl. 6.x. (even if both are not themed [VisualStyles = False] the controls are different)
Sorry, yes, you are correct. The EXE is running with a manifest, while the IDE is not. I think I remember seeing an article about putting a manifest on the IDE EXE... I'll look into that.
Quote:
Originally Posted by
Krool
What you mean with DateDblClick ? Please more context on that one.
DateDblClick is an event in the stock MonthView control in Common Controls 2. Private Sub MonthView1_DateDblClick(ByVal DateDblClicked As Date). It comes in handy when using the MonthView as a pop-up control, and double-clicking on the date selects it and closes the popup.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
hausman
FYI, I had changed the Attribute Text.VB_UserMemId = 0 to accomplish this. Not sure which method is best.
DateDblClick is an event in the stock MonthView control in Common Controls 2. Private Sub MonthView1_DateDblClick(ByVal DateDblClicked As Date). It comes in handy when using the MonthView as a pop-up control, and double-clicking on the date selects it and closes the popup.
The Text property cannot have the DISPID_TEXT and DISPID_DEFAULT at the same time. Thus the hidden helper property.
DateDblClick - ooh missed that one. However, the MonthView (SysMonthCal32 window) doesn't have the CS_DBLCLKS style, so it won't fire any WM_LBUTTONDBLCLK.
-
Re: CommonControls (Replacement of the MS common controls)
hi krool
i wanted to Create a ComboBox inside a Listview as the demo in the link but it is not possible.
The demo works fine with the MS common listview
Create a ComboBox inside a Listview
the error type mismatch occurs here
Code:
Public Sub GetLVCellData(pobjLV As ListView, _
psngX As Single, _
psngY As Single, _
ByRef pstrCellText As String, _
ByRef plngItemIndex As Long, _
ByRef plngSubItemIndex As Long)
Dim HTI As LVHITTESTINFO
Dim lst As ListItem
With HTI
.pt.X = (psngX \ Screen.TwipsPerPixelX)
.pt.Y = (psngY \ Screen.TwipsPerPixelY)
.Flags = LVHT_ONITEM
End With
SendMessage pobjLV.hwnd, LVM_SUBITEMHITTEST, 0, HTI
If (HTI.iItem > -1) Then
Set lst = pobjLV.ListItems(HTI.iItem + 1)
plngItemIndex = HTI.iItem + 1
plngSubItemIndex = HTI.iSubItem
If HTI.iSubItem = 0 Then
pstrCellText = pobjLV.ListItems(HTI.iItem + 1).Text
Else
pstrCellText = pobjLV.ListItems(HTI.iItem + 1).SubItems(HTI.iSubItem)
End If
Else
pstrCellText = ""
plngItemIndex = 0
plngSubItemIndex = 0
End If
End Sub
Code:
GetLVCellData lvwDemo, _
X, _
Y, _
mstrOriginalCellText, _
mlngClickedItemIndex, _
mlngClickedSubItemIndex
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mustaphi
hi krool
i wanted to Create a ComboBox inside a Listview as the demo in the link but it is not possible.
The demo works fine with the MS common listview
Create a ComboBox inside a Listview
the error type mismatch occurs here
Code:
Public Sub GetLVCellData(pobjLV As ListView, _
psngX As Single, _
psngY As Single, _
ByRef pstrCellText As String, _
ByRef plngItemIndex As Long, _
ByRef plngSubItemIndex As Long)
Dim HTI As LVHITTESTINFO
Dim lst As ListItem
With HTI
.pt.X = (psngX \ Screen.TwipsPerPixelX)
.pt.Y = (psngY \ Screen.TwipsPerPixelY)
.Flags = LVHT_ONITEM
End With
SendMessage pobjLV.hwnd, LVM_SUBITEMHITTEST, 0, HTI
If (HTI.iItem > -1) Then
Set lst = pobjLV.ListItems(HTI.iItem + 1)
plngItemIndex = HTI.iItem + 1
plngSubItemIndex = HTI.iSubItem
If HTI.iSubItem = 0 Then
pstrCellText = pobjLV.ListItems(HTI.iItem + 1).Text
Else
pstrCellText = pobjLV.ListItems(HTI.iItem + 1).SubItems(HTI.iSubItem)
End If
Else
pstrCellText = ""
plngItemIndex = 0
plngSubItemIndex = 0
End If
End Sub
Code:
GetLVCellData lvwDemo, _
X, _
Y, _
mstrOriginalCellText, _
mlngClickedItemIndex, _
mlngClickedSubItemIndex
It's LvwListItem and not anymore ListItem. Also please remove the references to MS common controls.
-
Re: CommonControls (Replacement of the MS common controls)
It's simple to implement that?
In the past years, I had added the manifest in my project. Hower the project was too slow
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool, is it possible to fix columns in the listview control, like it is with the VBFlexGrid control?
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Hello Krool,
I think I found a bug in the ComboBoxW: the Text property cannot be changed from inside the Click event.
To test it, add a VB.Combo and a ComboBoxW to a form, default style Dropdown List, and this code:
Code:
Private Sub Form_Load()
Combo1.AddItem "Item 1"
Combo1.AddItem "Item 2"
Combo1.AddItem "Item 3"
ComboBoxW1.AddItem "Item 1"
ComboBoxW1.AddItem "Item 2"
ComboBoxW1.AddItem "Item 3"
End Sub
Private Sub Combo1_Click()
Combo1.Text = Combo1.Text & " (" & Combo1.ListIndex & ")"
End Sub
Private Sub ComboBoxW1_Click()
ComboBoxW1.Text = ComboBoxW1.Text & " (" & ComboBoxW1.ListIndex & ")"
End Sub
PS: I'm using the OCX