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)..
Printable View
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.
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.
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
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.
Attachment 129471
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().
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
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.
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
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")
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).
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:
2 problems: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
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
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.
Attachment 131263
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?
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.
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 :)
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
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?
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.
Is it correctly working when you do not work with PNGs?
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.
Node.Next does not work as 'Next' is a locked keyword in VB6. You need to use Node.NextSibling instead in my TreeView.
(Toolbar)
No.
I now have an imagelist (comctl32.ocx) prefilled with BMPs.
Result:
Attachment 131337
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.
Maybe a dumb question, but if you are using BMP, have you set the transparent color of the imagelist to white?
@ 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.
Attachment 131341
@Krool
That would be an easy solution...Quote:
my ToolBar works correctly in your test, but only when the MinButtonWidth and MaxButtonWidth are set to 0 (zero).
This also works:
Kind of works, the button width is wrong then:Code:.Buttons.Clear
.MinButtonWidth = 0
.MaxButtonWidth = 0
Attachment 131343
Not an option, as the toolbars are not to distinguish at design time then.Quote:
but with no preset buttons created at design time.
Usually I have one button set just to know which toolbar it is.
Thank you Krool.
Im not able to check right now...
Is the TextAlignment property set to 'Bottom' instead of 'Right'?