-
Jun 23rd, 2015, 09:25 AM
#721
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)
Last edited by DEXWERX; Jun 23rd, 2015 at 12:41 PM.
-
Jun 23rd, 2015, 12:42 PM
#722
Lively Member
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.
For programs require the driverspacks, you can download torrent here
http://driveroff.net/sam/
or here http://driverpacks.net/driverpacks/latest
Last edited by Romeo91; Jun 23rd, 2015 at 12:51 PM.
-
Jun 25th, 2015, 04:52 PM
#723
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.
-
Jun 30th, 2015, 12:50 AM
#724
New Member
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...
-
Jun 30th, 2015, 07:37 AM
#725
Junior Member
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...
-
Jul 7th, 2015, 03:32 PM
#726
Re: CommonControls (Replacement of the MS common controls)
-
Jul 7th, 2015, 08:20 PM
#727
Frenzied Member
Re: CommonControls (Replacement of the MS common controls)
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.
Last edited by Jonney; Jul 7th, 2015 at 08:24 PM.
-
Jul 8th, 2015, 03:11 AM
#728
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
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..
-
Jul 8th, 2015, 12:49 PM
#729
Re: CommonControls (Replacement of the MS common controls)
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.
-
Jul 9th, 2015, 08:08 AM
#730
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....
Last edited by DEXWERX; Jul 9th, 2015 at 08:14 AM.
-
Jul 10th, 2015, 03:23 PM
#731
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.
-
Jul 10th, 2015, 04:45 PM
#732
Junior Member
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.
-
Jul 14th, 2015, 10:16 AM
#733
Junior Member
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
-
Jul 14th, 2015, 01:33 PM
#734
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Paul@QMC.net
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?
-
Jul 14th, 2015, 04:18 PM
#735
Junior Member
Re: CommonControls (Replacement of the MS common controls)
Thanks, we are checking the Demo project... Paul
-
Jul 15th, 2015, 03:38 PM
#736
New Member
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.
Last edited by vb6rocks!; Jul 16th, 2015 at 08:05 AM.
-
Jul 16th, 2015, 09:50 AM
#737
Junior Member
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
-
Jul 16th, 2015, 02:41 PM
#738
Re: CommonControls (Replacement of the MS common controls)
Update released.
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.
@ Paul@QMC.net
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.
Last edited by Krool; Jul 16th, 2015 at 02:46 PM.
-
Jul 16th, 2015, 05:11 PM
#739
Junior Member
Re: CommonControls (Replacement of the MS common controls)
Thanks, all looks good for total withdrawal from MS. Paul
-
Jul 17th, 2015, 05:23 AM
#740
New Member
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
-
Jul 17th, 2015, 06:18 AM
#741
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
-
Jul 17th, 2015, 07:51 AM
#742
New Member
Re: CommonControls (Replacement of the MS common controls)
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.
@ Paul@QMC.net
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.
-
Jul 20th, 2015, 08:23 AM
#743
Junior Member
Re: CommonControls (Replacement of the MS common controls)
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
-
Jul 20th, 2015, 01:45 PM
#744
Re: CommonControls (Replacement of the MS common controls)
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.
-
Jul 21st, 2015, 04:21 AM
#745
New Member
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
-
Jul 21st, 2015, 08:37 AM
#746
Junior Member
Re: CommonControls (Replacement of the MS common controls)
how do I set RightToLeft Property to the controls?
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.
-
Jul 21st, 2015, 11:00 AM
#747
Re: CommonControls (Replacement of the MS common controls)
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
-
Jul 22nd, 2015, 08:26 AM
#748
New Member
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
-
Jul 23rd, 2015, 01:47 PM
#749
Re: CommonControls (Replacement of the MS common controls)
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.
-
Jul 24th, 2015, 02:15 AM
#750
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
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..
-
Jul 25th, 2015, 02:23 PM
#751
Re: CommonControls (Replacement of the MS common controls)
The ActiveX Control version 1.2 is now available.
-
Aug 4th, 2015, 08:59 AM
#752
New Member
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,
-
Aug 4th, 2015, 10:43 AM
#753
Re: CommonControls (Replacement of the MS common controls)
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.
-
Aug 4th, 2015, 07:34 PM
#754
Frenzied Member
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?
vbPRPQDraft
vbPRPQlow
vbPRPQMedium
vbPRPQHigh
Last edited by Jonney; Aug 5th, 2015 at 02:52 AM.
-
Aug 11th, 2015, 01:47 PM
#755
Re: CommonControls (Replacement of the MS common controls)
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.
-
Aug 11th, 2015, 09:16 PM
#756
Frenzied Member
Re: CommonControls (Replacement of the MS common controls)
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.
-
Aug 14th, 2015, 08:54 AM
#757
Fanatic Member
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
•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.
-
Aug 14th, 2015, 02:21 PM
#758
Re: CommonControls (Replacement of the MS common controls)
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.
Last edited by Krool; Aug 14th, 2015 at 03:43 PM.
-
Aug 14th, 2015, 03:49 PM
#759
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
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.
Last edited by Tech99; Aug 14th, 2015 at 04:13 PM.
-
Aug 14th, 2015, 04:25 PM
#760
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Tech99
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.
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
|