-
Aug 14th, 2015, 07:04 PM
#761
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
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.
Yep, you're right, 2004 has 53 weeks, maybe it's because some internal weekday setting (which day of the week is the first day, normally it should be set to monday)..
-
Aug 14th, 2015, 07:41 PM
#762
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Thank you.
Week property returns right week number. However there is still that 53 vs. 1 week bug in drawn controls week numbering.
In Finland, where i am located first day of the week is monday, MSCOMCT2 shows right week numbering, despite of regional settings - i mean be it Finnish, US/English or what ever.
Last edited by Tech99; Aug 14th, 2015 at 07:47 PM.
-
Aug 15th, 2015, 02:08 AM
#763
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Tech99
Thank you.
Week property returns right week number. However there is still that 53 vs. 1 week bug in drawn controls week numbering.
In Finland, where i am located first day of the week is monday, MSCOMCT2 shows right week numbering, despite of regional settings - i mean be it Finnish, US/English or what ever.
I have no influence on the drawn week number. Thats a issue then from the comctl32.dll itself.
Edit: SysMonthCal32 with MCS_WEEKNUMBERS style will display week 53 if used with themes (comctl32.dll 6.x) and week 1 if used without themes. (comctl32.dll 5.x)
Last edited by Krool; Aug 15th, 2015 at 07:49 AM.
-
Aug 17th, 2015, 02:24 PM
#764
Re: CommonControls (Replacement of the MS common controls)
Is it then correct that the 28th December 2015 (when start of week is Monday) is week 53? Because there are not four days in the first week on the new year. (only three days)
MS MonthView returns also 53 in that scenario.
Last edited by Krool; Aug 17th, 2015 at 02:32 PM.
-
Aug 17th, 2015, 02:33 PM
#765
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
Is it then correct that the 28th December 2015 (when start of week is Monday) is week 53? Because there are not four days in the first week on the new year. (only three days)
MS MonthView returns also 53 in that scenario.
Yep 2015 has 53 weeks..
-
Aug 18th, 2015, 02:20 AM
#766
Member
Re: CommonControls (Replacement of the MS common controls)
Hello
I have adapted the "VBCCR10_To_11" converter has the new version.
It is now called "VBCCR_11_To_12.OCX_converter"
Manual:
1 - Save the OCX in the manner of your choice.
2 - Register the OCX with "regsvr32" or create a program using VB6 VBCCR12.
3 - Make a backup of the program has convert from (as a precaution).
4 - Launch the converter and open the ".vbp" .
A backup copy is created (.bak) for all converted files.
5 - Open the converted program.
An error is generated. This is normal, the version is set has "0.0" when converting.
VB6 will put the right value at the launch.
Good luck
Attachment 129353
Last edited by lrd_VB6; Aug 24th, 2015 at 11:29 AM.
-
Aug 20th, 2015, 03:01 PM
#767
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Hello Krool, is thre a way to adjust DTPicker checkbox size? Tested these more and found out that with display percentage scaling checkbox enlargens bit too much. Atachment is 125 percent scaled, when increasing display scaling checkbox does not fit in upper, left and lower bounds to inside drawn 'line' rectangle at the ownerdraw area. Same goes with datetext part, it is shifted/drawn bit too left.
-
Sep 2nd, 2015, 11:16 AM
#768
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Tech99
Hello Krool, is thre a way to adjust DTPicker checkbox size? Tested these more and found out that with display percentage scaling checkbox enlargens bit too much. Atachment is 125 percent scaled, when increasing display scaling checkbox does not fit in upper, left and lower bounds to inside drawn 'line' rectangle at the ownerdraw area. Same goes with datetext part, it is shifted/drawn bit too left.
I see no way to adjust the checkbox size...
-
Sep 11th, 2015, 05:23 PM
#769
Re: CommonControls (Replacement of the MS common controls)
Update released.
Included the StartOfWeek and Week property in the DTPicker control.
Fixed an embarrassing bug in the StartOfWeek property in the MonthView control...
The LParam in the MCM_SETFIRSTDAYOFWEEK message used a 'Integer' variable and can produce unpredictable results in 64-bit systems. (32-bit system seems to have no problems whatsoever)
This is now fixed with a CLng().
Last edited by Krool; Sep 12th, 2015 at 03:41 PM.
-
Sep 27th, 2015, 10:23 AM
#770
Lively Member
Re: CommonControls (Replacement of the MS common controls)
HI,
Sorry to ask but there is a massive amount of INFORMATION here but I think I have the jist please correct me if i'm wrong,
1) I have copied the VBCCR12.OCX to my windows\system32 dir and registered
2) in VB6 - Project References I have added windows\system32\VBCCR12.OCX - Now have all new controls in VB6 IDE
3) Also added reference to OLEGuids.tlb from the ComCtlsDemo\OLEGUIDs
4) created a program only using new controls
I now believed that for the program to work on any other machine, the VBCCR12.OCX just needs to be in same folder as my program .exe
Is this correct, thanks for help
-
Sep 27th, 2015, 12:50 PM
#771
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by jpskiller
HI,
Sorry to ask but there is a massive amount of INFORMATION here but I think I have the jist please correct me if i'm wrong,
1) I have copied the VBCCR12.OCX to my windows\system32 dir and registered
2) in VB6 - Project References I have added windows\system32\VBCCR12.OCX - Now have all new controls in VB6 IDE
3) Also added reference to OLEGuids.tlb from the ComCtlsDemo\OLEGUIDs
4) created a program only using new controls
I now believed that for the program to work on any other machine, the VBCCR12.OCX just needs to be in same folder as my program .exe
Is this correct, thanks for help
Hi,
you can skip point 3.) as the OLEGuids.tlb does not need to be referenced when using the OCX Version.
If you do use the Side-by-Side technique you just need to have the VBCCR12.OCX on the same folder.
Else it need to be registered, somewhere.
-
Sep 28th, 2015, 11:14 AM
#772
Lively Member
Re: CommonControls (Replacement of the MS common controls)
Cheers
Sounds daft but I thought, the final .exe file would some work without having to register the .ocx file on a different PC, reason why I need this is because I dont have admin rights on the user PC but still require to run my programs
how do I get round this?
-
Sep 28th, 2015, 02:16 PM
#773
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by jpskiller
Cheers
Sounds daft but I thought, the final .exe file would some work without having to register the .ocx file on a different PC, reason why I need this is because I dont have admin rights on the user PC but still require to run my programs
how do I get round this?
Then you need to use the Std-EXE way and not the OCX. On that way the controls (UserControls) are compiled into the exe. Reference to OLEGuids.tlb is needed on design time = IDE. But on target PC OLEGuids.tlb is not needed. So you got full "indepedence".
Read first post for full explanation and also the sources in the attachment for the Std-EXE way.
Last edited by Krool; Sep 28th, 2015 at 02:19 PM.
-
Sep 29th, 2015, 11:46 AM
#774
Lively Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
Then you need to use the Std-EXE way and not the OCX. On that way the controls (UserControls) are compiled into the exe. Reference to OLEGuids.tlb is needed on design time = IDE. But on target PC OLEGuids.tlb is not needed. So you got full "indepedence".
Read first post for full explanation and also the sources in the attachment for the Std-EXE way.
When you say Std-EXE I cant find any instructions on how thats done, and what sources, I can only find the Demo, do you mean I need to add everthing to my project's like it is in that example?
-
Oct 6th, 2015, 07:06 AM
#775
Lively Member
Re: CommonControls (Replacement of the MS common controls)
Hi,
I am getting an error when use treeview control, this code works with normal treeview but produces an error with the replacement one, all I need to do is simply not run any code when users clicks on + or - sign to expand a branch, if theres another way I would be grateful
The error is concerning "MSComctlLib.Node"
Private Sub TreeView1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.TreeView1.SelectedItem = Me.TreeView1.HitTest(X, Y)
End Sub
Private Sub TreeView1_Collapse(ByVal Node As MSComctlLib.Node)
bNodeImageClicked = True
End Sub
Private Sub TreeView1_Expand(ByVal Node As MSComctlLib.Node)
bNodeImageClicked = True
End Sub
Private Sub TreeView1_Click()
If bNodeImageClicked Then
bNodeImageClicked = False
Exit Sub
End If
If TreeView1.SelectedItem.Child Is Nothing Then
textwh1.Text = TreeView1.SelectedItem.Text
End If
End Sub
-
Oct 6th, 2015, 11:20 AM
#776
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by jpskiller
The error is concerning "MSComctlLib.Node"
Sure, you need to replace it to 'TvwNode'. The replacement is not the 'MSComctlLib'.
-
Oct 6th, 2015, 12:08 PM
#777
Lively Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
Sure, you need to replace it to 'TvwNode'. The replacement is not the 'MSComctlLib'.
Thanks thats resolved it cheers
-
Oct 11th, 2015, 03:17 AM
#778
Re: CommonControls (Replacement of the MS common controls)
The CommonControls are wonderful, thank Krool very much .
There are some questions when I use TreeView control:
(1) There is not 'ExpandedImage' property in TvwNode class
(2) The 'Image' and 'SelectedImage' properties of TvwNode can only accept 'long' parameter, not accept 'string' parameter, but MSComctlLib.Node can do so, such as objNode.Image = "Closed"
(3) When I create TreeView Control dynamically, the control can not fire 'NodeClick' event, such as:
Set TreeView1 = Me.Controls.Add("Project1.TreeView", "TreeView1")
-
Oct 11th, 2015, 09:56 AM
#779
Re: CommonControls (Replacement of the MS common controls)
Image and SelectedImage refer to the index of the image in the assigned imagelist; you'll have to use that instead of the Key (or modify the code to look up by key instead, but really using the index is the best way to approach it).
ExpandedImage is a Vista+ thing, there's other features missing too-- the TVITEMEX type doesn't have the other 6.0 members either (uStateEx that allows nodes to be grayed out as disabled).
-
Oct 11th, 2015, 11:35 AM
#780
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by dreammanor
(3) When I create TreeView Control dynamically, the control can not fire 'NodeClick' event, such as:
Set TreeView1 = Me.Controls.Add("Project1.TreeView", "TreeView1")
Did you declare 'WithEvents' for object variable TreeView1?
-
Oct 11th, 2015, 03:20 PM
#781
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Problem setting icons to the toolbar
Up to now I use the CC5 toolbar, and I want to replace it because of the fixed background color.
In the current system, I populate a CC5 image list with PNG pictures at runtime.
Then I add buttons to the toolbar like this:
Code:
Dim Btn As CommonControls.TbrButton
With MF.xbar(0)
.Buttons.Clear
.ImageList = MF.imgl_24
Set Btn = .Buttons.Add(, "ppa", , 0, 14)
Set Btn = .Buttons.Add(, "ppb", , 0, 15)
End With
2 problems:
1)
The button icons do not show.
When I move the mouse over the place where a button should be, I can see there is an empty button.
On the CC5 toolbar they are there and working.
2)
With the Krool toolbar, using the Add method, I can specify the picture by index number only, not by the key string.
If I use the key string, then a type mismatch error comes up, and the IDE crashes.
---
This does not get any better if I use the CommonControls.TbrButtonStyleDefault insetad of just 0.
It also doesn't change if I use the Krool imagelist.
Do I miss something, or is it just not possible to use PNGs?
And what is about the image index 'problem'?
Thanks,
Karl
-
Oct 11th, 2015, 10:16 PM
#782
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by fafalone
Image and SelectedImage refer to the index of the image in the assigned imagelist; you'll have to use that instead of the Key (or modify the code to look up by key instead, but really using the index is the best way to approach it).
ExpandedImage is a Vista+ thing, there's other features missing too-- the TVITEMEX type doesn't have the other 6.0 members either (uStateEx that allows nodes to be grayed out as disabled).
Thanks a lot.
-
Oct 11th, 2015, 10:53 PM
#783
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
Did you declare 'WithEvents' for object variable TreeView1?
Yes, I have declared 'WithEvents' for variable TreeView1:
Private WithEvents TreeView1 As Project1.TreeView.
The 'Click' event can be fired, but 'NodeClick' event can not. I tested it in Windows XP, Win7 and Win10.
-
Oct 12th, 2015, 03:51 AM
#784
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Ok, after fiddling with the right declarations I finally get the icon displayed.
But something is still wrong.
The toolbar shows 1 icon only, while 2 were set.
Also the transparency is wrong.
And there is no tooltip, while ShowTips = True.
The upper yellow toolbar is Krool's.
The lower is from comctl32.ocx.
Code:
Dim Btn As CommonControls.TbrButton
With MF.xbar(0)
.Buttons.Clear
.ImageList = MF.imgl_24
Set Btn = .Buttons.Add(, "ppa", , 0, 14)
Btn.ToolTipText = "14"
Set Btn = .Buttons.Add(, "ppb", , 0, 15)
Btn.ToolTipText = "15"
End With
Dim Btn5 As ComctlLib.Button
With MF.tbr_CC5
.Buttons.Clear
.ImageList = MF.imgl_24
Set Btn5 = .Buttons.Add(, "ppa", , 0, 14)
Btn5.ToolTipText = "14"
Set Btn5 = .Buttons.Add(, "ppb", , 0, 15)
Btn5.ToolTipText = "15"
End With
Hmm?
-
Oct 12th, 2015, 03:29 PM
#785
Re: CommonControls (Replacement of the MS common controls)
Important update released fixing the following issue:
Originally Posted by dreammanor
When I create TreeView Control dynamically, the control can not fire 'NodeClick' event, such as:
Set TreeView1 = Me.Controls.Add("Project1.TreeView", "TreeView1")
The issue was that on dynamically added controls only the "InitProperties" event in the UserControl is fired. Problem was that on some controls the UserControl.hWnd was not subclassed and thus caused some lacks of functionality. Like in your case with 'NodeClick' event not firing. This has been fixed by subclassing the UserControl.hWnd also in the "InitProperties" and not only in the "ReadProperties" event on run-time.
-
Oct 12th, 2015, 04:00 PM
#786
Lively Member
Re: CommonControls (Replacement of the MS common controls)
I have a questions about Treeview,
1) Is it possible to change the lost focus highlight colour?
cheers, great controls keep up the good work.
All I need now is a self contained MSGraph replacment
Last edited by jpskiller; Oct 12th, 2015 at 04:03 PM.
Reason: being an idiot
-
Oct 13th, 2015, 10:39 AM
#787
Lively Member
Re: CommonControls (Replacement of the MS common controls)
I am having real difficulty in get Treeview Keyup and Keydown to work how I want
All I want to do do is if press keyup or down then get the selected item text and if it is a child then call 1 proceudre and same if parent.
what seems to be happening is that if press up or down, it dosent register until the 2nd key press in same direction !
here's my code, any help would be appreciated
Private Sub TreeView1_NodeClick(ByVal Node As TvwNode, ByVal Button As Integer)
On Error GoTo MyErrorHandler
If Node.Parent Is Nothing Then
' top level node
Get_Totals (TreeView1.SelectedItem.Text)
NPS.ListItems.Clear
ManagerSelected = TreeView1.SelectedItem.Text
AgentSelected = ""
Else
If Node.Child Is Nothing Then
' child level node
Get_Agent_Surveys (TreeView1.SelectedItem.Text)
NPS_Bonus = CalcBonus(Text3.Text, Text4.Text, Text5.Text, Text6.Text)
AgentSelected = TreeView1.SelectedItem.Text
End If
End If
Exit Sub
MyErrorHandler:
End Sub
=================================================
Private Sub TreeView1_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo errorhandler:
Dim SaveIndex As Integer
SaveIndex = Me.TreeView1.Nodes.Count
If KeyCode = vbKeyDown Then
Call TreeView1_NodeClick(TreeView1.SelectedItem, 1)
End If 'End Sub
errorhandler:
End Sub
-
Oct 13th, 2015, 12:23 PM
#788
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by jpskiller
I am having real difficulty in get Treeview Keyup and Keydown to work how I want
I have tested on a TreeView created at design-time and one created at run-time and both are firing the KeyDown event with vbKeyDown. So do you have problem in getting the KeyDown event firing or something else?
Originally Posted by jpskiller
I have a questions about Treeview,
1) Is it possible to change the lost focus highlight colour?
You mean when HideSelection is False? There is no such color property available. The only way for you to get what you want is to modify the NM_CUSTOMDRAW handler at CDDS_ITEMPREPAINT in WindowProcUserControl.
Originally Posted by Karl77
Ok, after fiddling with the right declarations I finally get the icon displayed.
But something is still wrong.
The toolbar shows 1 icon only, while 2 were set.
Also the transparency is wrong.
And there is no tooltip, while ShowTips = True.
The upper yellow toolbar is Krool's.
The lower is from comctl32.ocx.
Code:
Dim Btn As CommonControls.TbrButton
With MF.xbar(0)
.Buttons.Clear
.ImageList = MF.imgl_24
Set Btn = .Buttons.Add(, "ppa", , 0, 14)
Btn.ToolTipText = "14"
Set Btn = .Buttons.Add(, "ppb", , 0, 15)
Btn.ToolTipText = "15"
End With
Dim Btn5 As ComctlLib.Button
With MF.tbr_CC5
.Buttons.Clear
.ImageList = MF.imgl_24
Set Btn5 = .Buttons.Add(, "ppa", , 0, 14)
Btn5.ToolTipText = "14"
Set Btn5 = .Buttons.Add(, "ppb", , 0, 15)
Btn5.ToolTipText = "15"
End With
Is it correctly working when you do not work with PNGs?
Last edited by Krool; Oct 13th, 2015 at 12:37 PM.
-
Oct 13th, 2015, 01:12 PM
#789
Lively Member
Re: CommonControls (Replacement of the MS common controls)
hi,
no the keydown and keyup event do trigger but what I am trying to do is when press down or up keys then call the same code that is in the nodeclick event for the new selected item which runs code depending if parent or child selected.
I have found other code around the web for normal treeview but it uses things like node.next these dont seem to be supported in this version.
example click on a child node with mouse, perform code in nodeclick, if then press either up or down then its fine but if then change direction on keyboard it dosent seem to update the selected item so nodeclick does same thing until press key in same direction again!
I appreciate the help and will admit to being a novice.
-
Oct 13th, 2015, 02:14 PM
#790
Re: CommonControls (Replacement of the MS common controls)
Node.Next does not work as 'Next' is a locked keyword in VB6. You need to use Node.NextSibling instead in my TreeView.
-
Oct 14th, 2015, 12:22 AM
#791
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
Important update released fixing the following issue:
The issue was that on dynamically added controls only the "InitProperties" event in the UserControl is fired. Problem was that on some controls the UserControl.hWnd was not subclassed and thus caused some lacks of functionality. Like in your case with 'NodeClick' event not firing. This has been fixed by subclassing the UserControl.hWnd also in the "InitProperties" and not only in the "ReadProperties" event on run-time.
The issue has been solved. thank Krool very much !
-
Oct 14th, 2015, 05:32 AM
#792
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
(Toolbar)
Originally Posted by Krool
Is it correctly working when you do not work with PNGs?
No.
I now have an imagelist (comctl32.ocx) prefilled with BMPs.
Result:
Also this time there are no tooltips on the upper toolbar.
Code is pretty much the same as with the PNG trial.
Using your imagelist instead makes no difference.
Thank you Krool.
-
Oct 14th, 2015, 06:57 AM
#793
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Karl77
(Toolbar)
No.
I now have an imagelist (comctl32.ocx) prefilled with BMPs.
Result:
Also this time there are no tooltips on the upper toolbar.
Code is pretty much the same as with the PNG trial.
Using your imagelist instead makes no difference.
Thank you Krool.
Can you create an sample project that demonstrate the error and post it here? Or send me via PM. Thanks
-
Oct 14th, 2015, 08:33 AM
#794
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
Can you create an sample project that demonstrate the error and post it here? Or send me via PM. Thanks
Sure.
I prefer PM, but now I found that it is not possible to attach something to a PM.
Or I'm too dense.
Please PM me your mail adress.
Thank you.
-
Oct 14th, 2015, 11:55 AM
#795
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
Maybe a dumb question, but if you are using BMP, have you set the transparent color of the imagelist to white?
-
Oct 14th, 2015, 12:38 PM
#796
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by SuperDre
Maybe a dumb question, but if you are using BMP, have you set the transparent color of the imagelist to white?
The usage of BMP was a test only.
They don't have any transparency and the white is in the picture itself.
And no, I didn't set the mask color to white.
-
Oct 14th, 2015, 01:15 PM
#797
Re: CommonControls (Replacement of the MS common controls)
@ Karl77,
my ToolBar works correctly in your test, but only when the MinButtonWidth and MaxButtonWidth are set to 0 (zero). Or by keeping MinButtonWidth and MaxButtonWidth like you have set but with no preset buttons created at design time.
Last edited by Krool; Oct 14th, 2015 at 01:18 PM.
-
Oct 14th, 2015, 02:02 PM
#798
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
@Krool
my ToolBar works correctly in your test, but only when the MinButtonWidth and MaxButtonWidth are set to 0 (zero).
That would be an easy solution...
This also works:
Code:
.Buttons.Clear
.MinButtonWidth = 0
.MaxButtonWidth = 0
Kind of works, the button width is wrong then:
but with no preset buttons created at design time.
Not an option, as the toolbars are not to distinguish at design time then.
Usually I have one button set just to know which toolbar it is.
Thank you Krool.
-
Oct 14th, 2015, 02:31 PM
#799
Re: CommonControls (Replacement of the MS common controls)
Im not able to check right now...
Is the TextAlignment property set to 'Bottom' instead of 'Right'?
Last edited by Krool; Oct 14th, 2015 at 03:04 PM.
-
Oct 14th, 2015, 02:59 PM
#800
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
Im not able to check right now...
Is the TextAlignment property set to 'Bottom' instead of 'Right'?
No, right is set.
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
|