-
Re: CommonControls (Replacement of the MS common controls)
I am definitely a proponent of Github. I can't expound enough of how beneficial it is to legacy projects like this. Especially ones that are this valuable to the community. (this is an amazing code base Krool)
It's quite a shame that CCRP didn't open their sources. (for similar reason's why the OCX's here are technically not open source)
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Hi, Krool!
Please see my project (https://github.com/ADIAProject/DIA), I can not understand in any of the components of the error. Or checkboxw from your kit or on the button that I use or scrollframe.
On checkbox has a black frame, but not on all elements, but only those which do not start at the time of focus.
Attachment 127819
For programs require the driverspacks, you can download torrent here
http://driveroff.net/sam/
or here http://driverpacks.net/driverpacks/latest
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
Included the network address validation functionality into the TextBoxW control.
When the property 'NetAddressValidator' is set to true the TextBoxW control is internally a "msctls_netaddress" window and not a "Edit" window.
Example of how to validate:
Code:
Private Sub Command1_Click()
TextBoxW1.NetAddressType = TxtNetAddressTypeIPv6Address
Dim ErrVal As Long
On Error Resume Next
TextBoxW1.ValidateNetAddress
ErrVal = Err.Number
On Error GoTo 0
If ErrVal <> 0 Then
TextBoxW1.ShowNetAddressErrorTip
Exit Sub
Else
MsgBox "Success!", vbOKOnly, "Validation Results"
End If
End Sub
The following point must be realized that "On Error Resume Next" on UserControls works:
- 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.
-
Re: CommonControls (Replacement of the MS common controls)
Please,
Use a static code analyzer how:
http://www.axtools.com/products-codesmart-vb6.php
or
http://www.mztools.com/v3/download.aspx
Your code is terrible!
Too many code Dead, function, variable, constants...
-
Re: CommonControls (Replacement of the MS common controls)
But it works well and gets rid of MS BS and their constantly inconsistent controls; a never ending MS MESS is now over...
-
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
pepegriyo
Your comment is too rude and could hurt Krool who put tremendous effort for this great project. I believe there're more than thousands around the world using Krool's open source CommonControls.
You can use FORMAT tools to format the alignment. Don't force us to use the tools.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Jonney
Your comment is too rude and could hurt Krool who put tremendous effort for this great project. I believe there're more than thousands around the world using Krool's open source CommonControls.
You can use FORMAT tools to format the alignment. Don't force us to use the tools.
Yes, it's not quite nice for Krool who put in a lot of work in the excellent controls, but the tools pepegriyo is refering to are about removing/pinpointing dead/unused variables/code, and it's good practice to use it as in the end it also makes life easier for yourself.. So it's not about format alignement, it's about removing dead code.. Format alignement is something that is always in the eye of the beholder, what you think is a good format might be crap for others (for instance, I think aligning all variable declaraction makes the code more readable, but others think it's just a waste of time..
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
pepegriyo
Even the best apps have these problems. Have you ever read the comments about the Doom source code by programmers who ported it to modern operating systems ? By all accounts its one huge mess but it changed the world still. As long as a program works well for the people using it, and its not too much of a hassle for the people maintaining it, this shouldn't really matter. Your concern about dead code and such only really matters when multiple developers are involved in its maintenance and these developers aren't the original creators who would have been aware of the quirks in the source code. In other words, its more of a concern for large open source projects that may be updated and maintained by hundreds of developers.
-
Re: CommonControls (Replacement of the MS common controls)
many lazy coders leave dead code in, as a sort of documentation, with references and placeholders for future work.
It's not the best practice, but honestly - not worth most people's time to fix.
If you don't like it - you can spend some time and clean it up yourself. That's the beauty of open source.
I don't know that I've ever heard an experienced programmer complain about dead code....
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
Fixed a critical and stupid bug in the CDDS_ITEMPREPAINT handler in the ListView control.
Most likely impact for the bug was when using the 'Tile' view.
-
Re: CommonControls (Replacement of the MS common controls)
control replacement changes and below is list of screen explored and changed basically for “Comctl32.ocx” (TabStrip, Toolbar, Statusbar, Progressbar, Treeview, Listview, Imagelist, Slider). We are working on phase manner to have better control with replacing "ComCtl32.ocx" file as first phase, once done with it we will work on to replace the “Comdlg32.ocx”.
Faced issues with below screens having Toolbar control with button click event. Commented currently as VBCCR11 doesn't have click event, we will revisit this once we found a solutions for this.
• frmMainTaskBar.frm (Toolbar)
o Private Sub ADVControl_ButtonClick(ByVal Button As VBCCR11.Button)
We have replaced COMDLG32.ocx control with VBCCR11.CommonDialog in below screens list. Since there is no control available in VBCCR11 control list (screenshot A) had to explore on sample application to study the replacement working. Based on the analysis found that on declaring in the screen as “Dim CommonDialog1 As New VBCCR11.CommonDialog” it worked Ok. However VBCCR11.CommonDialog control doesn’t support few events/methods/properties as stated hence have commented them.
• NumCopies = CommonDialog1.Copies
• CommonDialog1.FontBold = txtFontType(Index).FontBold
• CommonDialog1.FontItalic = txtFontType(Index).FontItalic
• CommonDialog1.FontName = txtFontType(Index).FontName
• CommonDialog1.FontSize = txtFontType(Index).FontSize
On Monday we will look into different screens for our commented properties/events/methods and possible fixing.
-
Re: CommonControls (Replacement of the MS common controls)
Krool, can you help on the following???
To update you,
Explored for more replacement control for Toolbar, ListView, CommonDialog as some events/methods/properties are not supported by “VBCCR” (VB Common Control Replacement). Below are the few links we explored. Lately we found one “ctoolbar” control (screenshot A) but it too had 2 events viz.DragDrop and DragOver similar to “VBCCR” control toolbar.
http://www.vbaccelerator.com/home/VB...ete_Source.asp
http://btmtz.mvps.org/listview/
http://www.freevbcode.com/ShowCode.asp?ID=5716
https://groups.google.com/forum/#!to...pi/4zsGrOEDdgg
Currently controls with below events/methods/properties are required in the “QMCAPFTProgram”.
• VBCCR Toolbar has only DragDrop, DragOver but application needs Toolbar button click event.
• VBCCR ListView has only DragDrop, DragOver, GotFocus, LostFocus but application needs Listview item click event.
• VBCCR CommonDialog doesn’t support below property.
o NumCopies = CommonDialog1.Copies
o CommonDialog1.FontBold = txtFontType(Index).FontBold
o CommonDialog1.FontItalic = txtFontType(Index).FontItalic
o CommonDialog1.FontName = txtFontType(Index).FontName
o CommonDialog1.FontSize = txtFontType(Index).FontSize
In the absence of replacement controls fulfilling the above requirements please let us know how you want us to proceed.
Thanks, Paul
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Currently controls with below events/methods/properties are required in the “QMCAPFTProgram”.
• VBCCR Toolbar has only DragDrop, DragOver but application needs Toolbar button click event.
• VBCCR ListView has only DragDrop, DragOver, GotFocus, LostFocus but application needs Listview item click event.
• VBCCR CommonDialog doesn’t support below property.
o NumCopies = CommonDialog1.Copies
o CommonDialog1.FontBold = txtFontType(Index).FontBold
o CommonDialog1.FontItalic = txtFontType(Index).FontItalic
o CommonDialog1.FontName = txtFontType(Index).FontName
o CommonDialog1.FontSize = txtFontType(Index).FontSize
Something in your environment is not OK as the ToolBar has a button click event, the ListView has a item click Event...
For the CommonDialog properties. Instead of ".FontBold" you should use ".Font.Bold". There is also no ".Copies" property in the CommonDialog class. The value can be retrieved and set via the "VB.Printer.Copies".
Are the events for ToolBar and ListView available in the Demo project?
-
Re: CommonControls (Replacement of the MS common controls)
Thanks, we are checking the Demo project... Paul
-
Re: CommonControls (Replacement of the MS common controls)
I believe the ListBoxW using style "1 - vbListBoxCheckbox" has a bug. When I set the selected state of an item in code, it is not rendering as checked in the UI. Furthermore, the selected state property of a checked item is not correctly returned as "True."
Sample snippet:
ListBoxW1.Selected(0) = True
This does not result in the first item of a ListBoxW being selected. The same snippet works fine against a native VB6 ListBox.
I cross referenced the common controls test harness and there are no ListBoxW controls with checkboxes used.
-
Re: CommonControls (Replacement of the MS common controls)
Moving all projects to VB6, latest SP...
• We will move to VB6 platform using same VBCCR11.ocx as it seems to give most event in VB6 than VB5 platform.
• We will work to replace Microsoft comdlg32.ocx and comctl32.ocx with VBCCR11.ocx. For other controls we need to do some research.
• If possible try to reach VB Programer and find his work on VB6.
• As suggested by you in the below example of Treeview control we will have to explore on the proper replacement for events/properties/methods and passing values.
‘>>>>
'Private Sub tvQMCProgram_NodeClick(ByVal Node As Node) - Old MS Mess w/Win XP to Win 10 and no-reason-whatsover MS BS Update just to cause complete chaos & stop all from working!
Private Sub tvQMCProgram_NodeClick(MyName) - New Krool w/no issues in VB6, for all Win Platforms
On Error Resume Next
Dim vTmp As Variant
'vTmp = Node.Key
'MyName = vTmp 'MS BS
vTmp = MyName 'Krool
StatusLabel.Enabled = True
‘<<<<
To update you,
We downloaded and installed the given “ComCtlsDemo.rar.zip” in the virtual Pc with VB5 but on full compiling (Ctrl + F5) ComCtlsDemo gave screenshot A error. Explored on this error and as per screenshot B details this application points to be VB6 application. However continued with ComCtlsDemo application and commented the code highlighted in screenshot C for similar issue across various forms.
This lead to screenshot D error “Missing: OLE Guid and interface definitions”. To fix this browsed to “ComCtlsDemo\OLEGuids” folder and picked “OLEGuids.tlb” which helped to fix the issue but started showing other issues like in screenshot E.
Further
• Setup a fresh virtual machine with VB6 and on it registered VBCCR11.OCX control. Created VB6- Test application, added Toolbar and Listview controls. In the screen code it displayed various events for both these controls (screenshot F).
• Next installed VB5 on this virtual machine having VB6. Created VB5- Test application added Toolbar and Listview controls. In the screen code it displayed only few events for both these controls as shown in QMCAPFTProgram (screenshot G).
• From this it seems VBCCR11.OCX –Toolbar and Listview are not fully compatible with VB5.
Summary> Use VB6
Or:
In VB5 use,
Private Sub Command1_Click()
On Error Resume Next
For I = 1 To tvQMCProgram.Nodes.Count + 1
IsChecked = tvQMCProgram.Nodes(I).Selected
MYOLDNAME = tvQMCProgram.Nodes(I).Text
If IsChecked = True Then
tvQMCProgram.Nodes(I).Selected = True
MyName = tvQMCProgram.Nodes(I).Text
Call tvQMCProgram_NodeClick(MyName)
tvQMCProgram.Nodes(I).Selected = False
tvQMCProgram.SingleSel = False
End If
Next I
j = tvQMCProgram.Nodes.Count
End Sub
By adding Button Control w/Krools TreeView
Thanks Krool, we are almost there,,, Paul
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
Quote:
Originally Posted by
vb6rocks!
I believe the ListBoxW using style "1 - vbListBoxCheckbox" has a bug. When I set the selected state of an item in code, it is not rendering as checked in the UI. Furthermore, the selected state property of a checked item is not correctly returned as "True."
There was an embarrassing bug in the Selected property that it just did not work in a single selection ListBoxW. This has been fixed now.
Also the "ItemClick" event will be fired when a change is resulted.
I know that in the intrinsic ListBox the checked item is rendered within the Selected property and the "ItemClick" event is fired once again when effectively a item is checked.
But in the ListBoxW control this has been changed as following: (Kind of break to MS ListBox)
- The "ItemCheck" event is fired when an item is effectively checked. This is more clear that this is seperated to the "ItemClick".
- When you want to change the checked state of an item by code then use the ItemChecked property and not the Selected property.
@ [email protected]
When using the Std-EXE method you need to have VB6.
For the OCX method, as you noticed, you will not be happy with VB5.
-
Re: CommonControls (Replacement of the MS common controls)
Thanks, all looks good for total withdrawal from MS. Paul
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Can you please provide me link to the latest download for VBCCR11.OCX control for VB6.
Thanks
-
Re: CommonControls (Replacement of the MS common controls)
The download links are in the first post of this thread:
http://www.vbforums.com/showthread.p...=1#post4277565
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Update released.
There was an embarrassing bug in the Selected property that it just did not work in a single selection ListBoxW. This has been fixed now.
Also the "ItemClick" event will be fired when a change is resulted.
I know that in the intrinsic ListBox the checked item is rendered within the Selected property and the "ItemClick" event is fired once again when effectively a item is checked.
But in the ListBoxW control this has been changed as following: (Kind of break to MS ListBox)
- The "ItemCheck" event is fired when an item is effectively checked. This is more clear that this is seperated to the "ItemClick".
- When you want to change the checked state of an item by code then use the ItemChecked property and not the Selected property.
@
[email protected]
When using the Std-EXE method you need to have VB6.
For the OCX method, as you noticed, you will not be happy with VB5.
Thanks Krool! I'll download the latest version and give it a shot.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
in the List of revisions:
31-May-2015
- Included the ForeColor/Style/DownPicture/DisabledPicture/UseMaskColor/MaskColor/DrawMode property and OwnerDraw event in the CommandButtonW control.
Sorry, but why cant I see those properties and event, I have revision 38
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
ishalom
Sorry, but why cant I see those properties and event, I have revision 38
That update was released after VBCCR11.OCX was published. Only bugfixes are implemented into the VBCCR11.OCX as those revisions do not break compatibility. Either you use the Std-EXE Version or wait until VBCCR12.OCX will be published.
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
We are using VBCCR11.ocx.
Declaring object variable gives error. What is the alternative. Please suggest.
Dim mnodEditNode As Node
Dim itmX As ListItem
Dim imgX As ListImage
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
how do I set RightToLeft Property to the controls?
Quote:
You can't. The controls are same as the ambient RighToLeft property.
It's not working, is it possible to add the RightToLeft on each control like VBs controls do have.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
PankajMewada
We are using VBCCR11.ocx.
Declaring object variable gives error. What is the alternative. Please suggest.
Dim mnodEditNode As Node
Dim itmX As ListItem
Dim imgX As ListImage
The object names are slightly different. The following should work:
Dim mnodEditNode As TvwNode
Dim itmX As LvwListItem
Dim imgX As ImlListImage
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
We replaced microsoft comctl32.ocx and comdlg32.ocx with VBCCR11.ocx in VB6 application. But noted the Toolbar was reset to default height and Toolbar buttons there in microsoft toolbar were missing now, the ImageList too was having images but after replacement it was empty.
FYI: We have only changed references of control.
Please let us know what steps we need to follow so the above control details remain as it is.
Regards
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
PankajMewada
We replaced microsoft comctl32.ocx and comdlg32.ocx with VBCCR11.ocx in VB6 application. But noted the Toolbar was reset to default height and Toolbar buttons there in microsoft toolbar were missing now, the ImageList too was having images but after replacement it was empty.
FYI: We have only changed references of control.
Please let us know what steps we need to follow so the above control details remain as it is.
You need to create them new from scratch, e.g. inserting again the images in the ImageList control.
If somebody knows how to avoid this "issue" please let me know.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
You need to create them new from scratch, e.g. inserting again the images in the ImageList control.
If somebody knows how to avoid this "issue" please let me know.
Change the link to the OCX control in the frm outside (the first line(s) in the frm when opened in a texteditor) the IDE before loading the project? I don't know if it will work in this case..
-
Re: CommonControls (Replacement of the MS common controls)
The ActiveX Control version 1.2 is now available.
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Please let us know the difference between ActiveX control VBCCR11.ocx and VBCCR12.ocx.
Thank You,
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
PankajMewada
Please let us know the difference between ActiveX control VBCCR11.ocx and VBCCR12.ocx.
Only bugfixes were implemented by the time into the VBCCR11.OCX and not any new functionality.
The Std-EXE project is always up-to-date but the OCX project not. Only every half year or so there is a new version with all the added functionalities.
-
Re: CommonControls (Replacement of the MS common controls)
in ShowPrinterEx:
VB.Printer.PrintQuality = DMODE.DMPrintQuality doesn't work.
I see DMODE.DMPrintQuality =300 but .PrintQuality always maintains 600dpi.
is the unit dpi or VB Constants?
Quote:
vbPRPQDraft
vbPRPQlow
vbPRPQMedium
vbPRPQHigh
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Jonney
in ShowPrinterEx:
VB.Printer.PrintQuality = DMODE.DMPrintQuality doesn't work.
I see DMODE.DMPrintQuality =300 but .PrintQuality always maintains 600dpi.
is the unit dpi or VB Constants?
This seems to be a common issue.
You can avoid this issue by not be dependent on the VB.Printer object.
For instance you can include the flag 'CdlPDReturnDC' in the '.Flags' property of the CommonDialog class and use the '.hDC' property at return from the dialog box.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
This seems to be a common issue.
You can avoid this issue by not be dependent on the VB.Printer object.
For instance you can include the flag 'CdlPDReturnDC' in the '.Flags' property of the CommonDialog class and use the '.hDC' property at return from the dialog box.
Thank you sir, I got it.
-
Re: CommonControls (Replacement of the MS common controls)
Thank you Krool. Excellent replacement controls. However - quickly looked contols properties and found out, that from DTPicker and Monthview controls - Week property is missing.
https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
Quote:
•The Week property returns the number of the week containing the selected date.
Same applies to Monthview control also.
https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
So at least these does not function as 'drop in' replacement/substitutes for the MS DTPicker or Monthview controls.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Tech99
Thanks for this info. Just want to mention that the MS DTPicker (for VB6) do not have a 'Week' property. Only the MS MonthView control has.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Attachment 129239
Quote:
Originally Posted by
Krool
Just want to mention that the MS DTPicker (for VB6) do not have a 'Week' property.
Yes, so it seems, despite of MS online documentation.
https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
Fiddled with some calendar dates. There is a bug in week numbering display (week 53 vs. 1) also, altought this is corect in MS component.
fex. 29/12/2003 is week 1 not 53.
Attachment in left is MS common control-2 SP6 version MSCOMCT2.OCX and in right replacement control.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Tech99
Attachment 129239
Yes, so it seems, despite of MS online documentation.
https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
Fiddled with some calendar dates. There is a bug in week numbering display (week 53 vs. 1) also, altought this is corect in MS component.
fex. 29/12/2003 is week 1 not 53.
Attachment in left is MS common control-2 SP6 version MSCOMCT2.OCX and in right replacement control.
Update released.
Included the Week property in the MonthView control.
Also the workaround for bug in the DatePart function is implemented as the MS MonthView does also.
Though I let it allow to set a Week 53 in the Property Let procedure as the MS MonthView allows also.
Another point is that the MS MonthView calculates the week based on the system setting and not based on the start of week setting set for the control. This is weird. So I decided to always base on the start of week setting set to the control.
Also did some internal improvements in the DTPicker and MonthView control concerning the Year/Month/Day and Hour/Minute/Seconds property.
Thanks for your help.