-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Update released.
The performance of the ToolBar has been increased.
This was achieved by internally doing at some points (if applicable) a invalidation instead of a refresh.
Very good, works well, thanks.
Quote:
Changing .TextAlignment will cause re-creating of the control. During the re-creation LockWindowUpdate is used:
Quote:
Maybe LockWindowUpdate does cause a screen flicker in your particular app, just a guess.
It does.
I don't use LockWindowUpdate in the app, which could be the cause.
Also I don't know of other controls that do, at least I can't find because they are compiled (CC5).
Understood.
This improvement will work for sure if VBCCR is alone in the world.
Quote:
Solution could be to set the .TextAlignment already at design-time to the wanted value.
This solution works very ok.
Changing .TextAlignment is very unlikely.
Flickering is solved so far.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
Understood.
This improvement will work for sure if VBCCR is alone in the world.
Also see http://fgaillard.com/2011/02/the-unf...-wm_setredraw/
I won't switch back to WM_SETREDRAW. :)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Very informative.
The desktop flicker occurs when the handle is 0, right?
My initial problem is solved anyway.
But it is interesting why the flicker comes up in your Recreate.
Quote:
I won't switch back to WM_SETREDRAW. :)
Why should you?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
The performance of the ToolBar has been increased.
This was achieved by internally doing at some points (if applicable) a invalidation instead of a refresh.
I forgot to report the advantage.
Before: 250 msec. and more
Now: 16 msec., and less
-
No unicode support at the list view event "OLEDragDrop"
VBCCR14.OCX v1.4.0.50
Control: ListView in Report mode
hi krool,
i drag and dropped a folder with unicode characters in the name from the windows explorer on the list view in report mode but the event "OLEDragDrop" just returns the folder path in ANSI and the unicode characters are replaced with char "?".
Is this something you can fix?
-
1 Attachment(s)
List View "Right To Left" not work
VBCCR14.OCX v1.4.0.50
Control: ListView in Report mode
Hi Krool,
i use the following code with a list view in report mode but the content of the list view doesnt get mirrored as expected:
lvwFF.RightToLeft = True
lvwFF.RightToLeftLayout = True
i tried that code with win7x64 and the display language arabic.
Any ideas why this is not working?
Attachment 152451
-
Re: List View "Right To Left" not work
Quote:
Originally Posted by
Mith
VBCCR14.OCX v1.4.0.50
Control: ListView in Report mode
Hi Krool,
i use the following code with a list view in report mode but the content of the list view doesnt get mirrored as expected:
lvwFF.RightToLeft = True
lvwFF.RightToLeftLayout = True
i tried that code with win7x64 and the display language arabic.
Any ideas why this is not working?
Attachment 152451
How is .RightToLeftMode set?
-
1 Attachment(s)
Re: List View "Right To Left" not work
Quote:
How is .RightToLeftMode set?
.RightToLeftMode = CCRightToLeftModeVBAME
i didnt set/changed this option. its the standard value.
ok, i could solve the problem after changing the value to:
.RightToLeftMode =CCRightToLeftModeNoControl
Attachment 152465
thx for the hint!
-
3 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Update released.
This time the CoolBar control got my attention to make the control better.
First bugfix is that changing the VerticalGripper property on a vertical orientation CoolBar control was cumbersome.
The solution was to reset all header size dimensions to -1, thus the control has to recalculate them.
Second bugfix was that the HideCaption property of a Band was never written to the property bag.. easy fix to include in WriteProperties.
The actual improvement (make the control better) is as following:
The ForeColor of a Band (whether derived via 'UseCoolBarColors' or directly) was not supported when visual styles are applied.
However, that improvement works only on Vista+ (minimum comctl32.dll 6.1) since DrawThemeTextEx is not supported in Windows XP.
Attachment 152501
But there is another glitch that is fixed also for Windows XP. (MS never fixed this since Windows XP)
However, that glitch does not appear when visual styles are not applied.
The glitch can be replicated in following scenario:
Orientation = 1 - Vertical
VerticalGripper = True
3 Bands with initial settings except MinHeight of 1st Band set to 800 and input Caption text of "asd asd yxcyxc".
Then at run-time drag the band from left to right.
Before:
Attachment 152503
After:
Attachment 152505
As can be seen the text "asd asd yxcyxc" is measured by MS always on top-left and not the actual band coordinates.
These enhancements can be switched off by the conditional compilation constant 'ImplementThemedReBarFix'.
-
Re: No unicode support at the list view event "OLEDragDrop"
Quote:
Originally Posted by
Mith
VBCCR14.OCX v1.4.0.50
Control: ListView in Report mode
hi krool,
i drag and dropped a folder with unicode characters in the name from the windows explorer on the list view in report mode but the event "OLEDragDrop" just returns the folder path in ANSI and the unicode characters are replaced with char "?".
Is this something you can fix?
i used this code:
Code:
Private Sub lvwTest_OLEDragDrop(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, y As Single)
Dim I As Long
If data.GetFormat(vbCFFiles) Then
For I = 1 To data.Files.Count
' data.Files.Item(I) is ANSI and contains no unicode characters
Next I
End If
End Sub
-
Re: No unicode support at the list view event "OLEDragDrop"
Quote:
Originally Posted by
Mith
i used this code:
Code:
Private Sub lvwTest_OLEDragDrop(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, y As Single)
Dim I As Long
If data.GetFormat(vbCFFiles) Then
For I = 1 To data.Files.Count
' data.Files.Item(I) is ANSI and contains no unicode characters
Next I
End If
End Sub
http://cyberactivex.com/UnicodeTutor...gDrop_or_Paste
-
Re: No unicode support at the list view event "OLEDragDrop"
Quote:
Originally Posted by
Krool
How about we implement this inside VBCCR14.OCX to support unicode at the OLEDragDrop-event for all controls?
-
Re: CommonControls (Replacement of the MS common controls)
SUBCLASSING ADVICE
Up to now I use SSUBTMR6.DLL for subclassing.
From now on, I want to use the same technique that Krool uses in his controls.
I'm stuck.
Implements ISubclass creates the ISubclass_Message function, and I could do what I want from there.
But I don't know how to bring messages into the game.
In SSUBTMR6.DLL I simply had to attach/detach messages, which I could process in ISubclass_WindowProc.
How does it work with Krool's subclassing?
A very basic example would help me out.
Thank you.
Edit:
I try this in the main form of the example (post #1).
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
SUBCLASSING ADVICE
Up to now I use SSUBTMR6.DLL for subclassing.
From now on, I want to use the same technique that Krool uses in his controls.
I'm stuck.
Implements ISubclass creates the ISubclass_Message function, and I could do what I want from there.
But I don't know how to bring messages into the game.
In SSUBTMR6.DLL I simply had to attach/detach messages, which I could process in ISubclass_WindowProc.
How does it work with Krool's subclassing?
A very basic example would help me out.
Thank you.
Edit:
I try this in the main form of the example (post #1).
Krool's method (common controls subclassing) does not filter messages. unless intercepted, you get them all.
also you gotta make sure you forward to ComCtlsDefaultProc (DefSubclassProc) in your ISubclass_Message
Code:
Option Explicit
Implements ISubclass
Private Sub Form_Load()
ComCtlsSetSubclass hWnd, Me, 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
ComCtlsRemoveSubclass hWnd
End Sub
Private Function ISubclass_Message(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal dwRefData As Long) As Long
Select Case wMsg
Case WM_DESTROY
End Select
ISubclass_Message = ComCtlsDefaultProc(hWnd, wMsg, wParam, lParam)
End Function
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
DEXWERX
Krool's method (common controls subclassing) does not filter messages. unless intercepted, you get them all.
also you gotta make sure you forward to ComCtlsDefaultProc (DefSubclassProc) in your ISubclass_Message
Code:
Option Explicit
Implements ISubclass
Private Sub Form_Load()
ComCtlsSetSubclass hWnd, Me, 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
ComCtlsRemoveSubclass hWnd
End Sub
Private Function ISubclass_Message(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal dwRefData As Long) As Long
Select Case wMsg
Case WM_DESTROY
End Select
ISubclass_Message = ComCtlsDefaultProc(hWnd, wMsg, wParam, lParam)
End Function
Thank you DEXWERX.
That was very helpful.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
PAGER PROBLEMS
See attached project.
Attachment 152591
There are 3 Pagers.
Pager1 (red) is vertical.
Buddycontrol is Picture1, set at design time.
Pager2 (blue) is horizontal.
Buddycontrol is Picture2, set at design time.
Pager3 (lila) is horizontal.
Buddycontrol is Toolbar1, set at design time.
a)
When I start, only Pager3 catches the Buddy correct.
To assign the Buddies in Form:Load doesn't help.
When the Form is loaded, the CommandButton works to do it.
b)
Now let's resize the form manually.
Watch the Pager Buttons.
The Pager shows it's Button wrong.
It doesn't refer to the contained window size.
Also when we resize back and forth, this Button shows up at different window sizes.
---
With a toolbar as the contained window, it works ok.
Do I do something wrong, or is a PictureBox not suitable for a Pager?
Thanks
Karl
-
1 Attachment(s)
How to center the icons at the column header & the subitems?
VBCCR14.OCX v1.4.0.56
Control: ListView in Report mode
Does anyone know how to center the icons at the column header and the subitems?
Attachment 152623
-
Re: CommonControls (Replacement of the MS common controls)
Code:
ListView1.ColumnHeaders.Add , , "Name", 2000, LvwColumnHeaderAlignmentLeft
ListView1.ColumnHeaders.Add , , "Symbol", 1200, LvwColumnHeaderAlignmentCenter
ListView1.ColumnHeaders.Add , , "Anything", 1200, LvwColumnHeaderAlignmentRight
or
Code:
ListView1.ColumnHeaders(2).Alignment = LvwColumnHeaderAlignmentCenter
-
Re: CommonControls (Replacement of the MS common controls)
is there a tool ,can be used to upgrade or migrate VB common Controls sp6 to CCRP v 1.4 ???
had any one ade or used a tool like this , speciall for ToolBar and ImageList ... ??
if yes please guide me or provie me a link to such tool
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
PAGER PROBLEMS
There are 3 Pagers.
Pager1 (red) is vertical.
Buddycontrol is Picture1, set at design time.
Pager2 (blue) is horizontal.
Buddycontrol is Picture2, set at design time.
Pager3 (lila) is horizontal.
Buddycontrol is Toolbar1, set at design time.
a)
When I start, only Pager3 catches the Buddy correct.
To assign the Buddies in Form:Load doesn't help.
When the Form is loaded, the CommandButton works to do it.
b)
Now let's resize the form manually.
Watch the Pager Buttons.
The Pager shows it's Button wrong.
It doesn't refer to the contained window size.
Also when we resize back and forth, this Button shows up at different window sizes.
---
With a toolbar as the contained window, it works ok.
Do I do something wrong, or is a PictureBox not suitable for a Pager?
There is indeed a specialty with the PictureBox control.
It seems that the PictureBox will be re-sized by the Pager control. Also the issue with not able to set at design-time or at Form_Load is strange.
For example setting a FrameW control (pure VB.UserControl only) works without issues.
However, with following workaround you get the PictureBox behavior also correct:
Code:
Private Sub Form_Load()
' Preserve dimensions as the PictureBox will be re-sized by Pager control due to unknown reasons..
H1 = Picture1.Height + (Pager1.BorderWidth * 2)
W1 = Picture2.Width + (Pager2.BorderWidth * 2)
End Sub
Don't let the Pager control calculate the sizes automatically, adjust to preserved dimensions accordingly.
Code:
Private Sub Pager1_CalcSize(Width As Single, Height As Single)
Height = H1
End Sub
Private Sub Pager2_CalcSize(Width As Single, Height As Single)
Width = W1
End Sub
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
There is indeed a specialty with the PictureBox control.
It seems that the PictureBox will be re-sized by the Pager control. Also the issue with not able to set at design-time or at Form_Load is strange.
For example setting a FrameW control (pure VB.UserControl only) works without issues.
I wondered why my PictureBox size changes magically as well.
Of course I investigated my code first...
Ok, this workaround will work.
In my case the PictureBox size is quite dynamic, and I need to set and get the size often.
This workaround is too cumbersome for me.
I will use FrameW with BorderStyle = 0.
(Just found out that 0 doesn't draw frame and caption).
Solved so far, thank you.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
chosk
Code:
ListView1.ColumnHeaders.Add , , "Name", 2000, LvwColumnHeaderAlignmentLeft
ListView1.ColumnHeaders.Add , , "Symbol", 1200, LvwColumnHeaderAlignmentCenter
ListView1.ColumnHeaders.Add , , "Anything", 1200, LvwColumnHeaderAlignmentRight
or
Code:
ListView1.ColumnHeaders(2).Alignment = LvwColumnHeaderAlignmentCenter
I tried this code but is doesnt center the icons at the columnheader and the subitem.
Columnheader:
Adding one space char at the text property of the columnheader fixed the problem and the columnheader icon gets centered with the text (" ").
Subitem:
I also added a space char to the text property of the subitem but the icon of the subitems is still left-aligned...
Attachment 152653
Maybe krool can check if this is a bug inside his code or a MS-related problem...
-
4 Attachment(s)
RichTextBox font display problem
hi krool,
i loaded two different files with unicode text into the RichTextBox and the font always was changed automatically at a specific line.
Here at the 3. line:
Attachment 152717
Download: Attachment 152721
and here at the 7. line:
Attachment 152719
Download: Attachment 152723
Code:
rtfTest.LoadFile sFile$, RtfLoadSaveFormatUnicodeText
After loading the unicode files i had set the font again but it doesnt changed the font display at the RichTextBox...any hints whats going here?
-
Re: CommonControls (Replacement of the MS common controls)
the control automatically jumps to font substitution as soon as you get to a character not available in the original font.
try using a font that has those characters already.
-
Re: CommonControls (Replacement of the MS common controls)
ListBoxW etc. is lack of DataMember, DataSource, DataFeild,DataFormat properties... Can you implement those like VBFlexGrid?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
DEXWERX
the control automatically jumps to font substitution as soon as you get to a character not available in the original font.
try using a font that has those characters already.
Thank you very much for that hint!
Setting the font of the RichTextBox to "Arial Unicode MS" fixed the problem!
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
Certain tweaks done in order to run better in the VBA environment.
In theory those tweaks only would effect the OCX version. However, to be in sync the Std-EXE version got tweaked as well.
There is no actual difference for VB6 IDE. It works like before.
But for new VBCCR14.OCX (rev 61 onwards) and for future VBCCR15.OCX the support for the VBA IDE is better.
Certainly newer Office version (e.g. 2010) is not so "sensitive" as older Office version (e.g. XP, 2002) for crashes.
However, all tests are done in Office 2002 to be reliable.
Also the "Cannot call friend function on object which is not an instance of defining class" error for the class collection objects is fixed. (VBA only)
In order to replace to new version of the OCX it is strongly recommended to delete certain cache files for MS Office:
Code:
C:\Users\<username>\AppData\Local\Temp\VBE\VBCCR14.exd
Code:
C:\Users\<username>\Application Data\Microsoft\Forms\VBCCR14.exd
Those cache files do only exist when previously loaded VBCCR14 into the toolbox on a UserForm.
Then replace the new VBCCR14.OCX in the system directory.
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
Again some further tweaks to run better in the VBA environment.
There might be some pitfalls left. (e.g. StatusBar is known to still makes some troubles)
However, as described in previous post the cache files should be deleted (again) when attempting to replace the OCX.
-
Re: CommonControls (Replacement of the MS common controls)
Tested newest version, ListView downward dragging bug still exists.
http://www.vbforums.com/showthread.p...=1#post5087103
Also with MultiSelect=True, dragging moves only item under mouse cursor.
and...
Code:
LvwListItem.ListSubItems.Add objSub.Index, objSub.Key, objSub.Text, objSub.ReportIcon, objSub.ToolTipText
Wrong number of parameters -> missing tooltip parameter.
https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Tech99
Update released.
Thanks for the hint of missing 'ToolTipText' parameter in .ListSubItems.Add in the ListView control.
Also good that this has been fixed now before the release of VBCCR15. (VBCCR14 can not be fixed in this regard due to binary compatibility)
Concerning the downward dragging. This might not be a bug, rather a feature when 'SnapToGrid' property is True. :)
-
Re: CommonControls (Replacement of the MS common controls)
Hi all ,
I need to use the latest features for the ocx , but as Krool stated , he will release version 5 later this year or the next one . I tried to build a new activex control project and attach the controls and all common elements to it but it is difficult for me to set instances for class modules . I tried to open the STDexe project and change its type to activex control project after removing all forms and setting all user controls to public but did not work too . I think this is something related to conditional compiling . I need an activex control project holding the controls to be able to compile them to the ocx version or use the project itself in a group project without compliling . How can I do this ? and what I am missing here ? krool .
-
Re: CommonControls (Replacement of the MS common controls)
I see no problem in what you're trying to achieve but make sure you changed the CLSID of the project AND the output filename of the OCX to avoid compatibility issue. if someone make a commercial product out of krool ocx and on the same computer the client is using your product, one of the program (eitheir the commercial product or yours) won't load...
EDIT: in the first few post, KROOL made the exact same warning about this.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
VbNetMatrix
I see no problem in what you're trying to achieve but make sure you changed the CLSID of the project AND the output filename of the OCX to avoid compatibility issue. if someone make a commercial product out of krool ocx and on the same computer the client is using your product, one of the program (eitheir the commercial product or yours) won't load...
EDIT: in the first few post, KROOL made the exact same warning about this.
Thanks ,vbnet . Regardless of the point of compatibility , the program raises errors after changing its type to Activex control .
here is what I have done :
1- I opened the STDexe project
2- removed all forms
3- changed its type to activex control project
4- A message appears " the project (start mode) property has changed "
5- set all user controls to public
6- set the "IsubClass" class module instances to global multiuse .
7- removed the line which loads the main form from Sub_main()
8- tried to compile to ocx , then error is raised as the next picture implies
Attachment 153369
what is missed here?
-
Re: CommonControls (Replacement of the MS common controls)
Hosam, I will soon release VBCCR15.OCX for sure.
So I suggest you wait a little bit further.
The point is I want to ensure VBA works pretty good from the beginning of VBCCR15.
I am almost done. 2 updates already released for VBA improvement. But a 3 (final one) is needed.
So again, please little patience. :)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Hosam, I will soon release VBCCR15.OCX for sure.
So I suggest you wait a little bit further.
The point is I want to ensure VBA works pretty good from the beginning of VBCCR15.
I am almost done. 2 updates already released for VBA improvement. But a 3 (final one) is needed.
So again, please little patience. :)
No offense krool , take your time . I am not hustling you at all . I know it is a headache developing such GIANT project . But if you dont mind , I am still in need to solve this problem because I want to accomplish a base for my new project and I want to work on the level of user controls not the ocx or make it as a separate ocx maybe after some final customization . Also I want to solve it to add this problem to my too little knowledge . Thanks for your patience Krool.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Hosam AL Dein
Thanks ,vbnet . Regardless of the point of compatibility , the program raises errors after changing its type to Activex control .
here is what I have done :
1- I opened the STDexe project
2- removed all forms
3- changed its type to activex control project
4- A message appears " the project (start mode) property has changed "
5- set all user controls to public
6- set the "IsubClass" class module instances to global multiuse .
7- removed the line which loads the main form from Sub_main()
8- tried to compile to ocx , then error is raised as the next picture implies
Attachment 153369
what is missed here?
the image you provide is blurry and I cannot read it to see the error msg.
it seem to do with the public enum wich cannot be passed at outside perogative (normal)
however, did you tried to compare your change with the existing (previous version) ocx project ?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
VbNetMatrix
the image you provide is blurry and I cannot read it to see the error msg.
it seem to do with the public enum wich cannot be passed at outside perogative (normal)
however, did you tried to compare your change with the existing (previous version) ocx project ?
I did not change anything in code . I think this is due to conditional compiling for enums variables which varies from one project type to another .
If you or anyone here can make this and provide me with the proper steps I will be so grateful . I want to know how this is done to at least increase my knowledge .
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Hosam AL Dein
I did not change anything in code . I think this is due to conditional compiling for enums variables which varies from one project type to another .
If you or anyone here can make this and provide me with the proper steps I will be so grateful . I want to know how this is done to at least increase my knowledge .
I did a little tinkering for that it looks like you need to remove some of the code in the ComCtlsBase module, and put it in the ISubclass class module.
krool has put this code I different locations in the ocx source code then in the exe, I am not sure why. Please enlighten us krool
below is the code you should move, try it and report your results, so others can be helped
Code:
#If False Then
Private OLEDropModeNone, OLEDropModeManual
Private CCAppearanceFlat, CCAppearance3D
Private CCBorderStyleNone, CCBorderStyleSingle, CCBorderStyleThin, CCBorderStyleSunken, CCBorderStyleRaised
Private CCBackStyleTransparent, CCBackStyleOpaque
Private CCLeftRightAlignmentLeft, CCLeftRightAlignmentRight
Private CCVerticalAlignmentTop, CCVerticalAlignmentCenter, CCVerticalAlignmentBottom
Private CCIMEModeNoControl, CCIMEModeOn, CCIMEModeOff, CCIMEModeDisable, CCIMEModeHiragana, CCIMEModeKatakana, CCIMEModeKatakanaHalf, CCIMEModeAlphaFull, CCIMEModeAlpha, CCIMEModeHangulFull, CCIMEModeHangul
Private CCRightToLeftModeNoControl, CCRightToLeftModeVBAME, CCRightToLeftModeSystemLocale, CCRightToLeftModeUserLocale, CCRightToLeftModeOSLanguage
#End If
Public Enum OLEDropModeConstants
OLEDropModeNone = vbOLEDropNone
OLEDropModeManual = vbOLEDropManual
End Enum
Public Enum CCAppearanceConstants
CCAppearanceFlat = 0
CCAppearance3D = 1
End Enum
Public Enum CCBorderStyleConstants
CCBorderStyleNone = 0
CCBorderStyleSingle = 1
CCBorderStyleThin = 2
CCBorderStyleSunken = 3
CCBorderStyleRaised = 4
End Enum
Public Enum CCBackStyleConstants
CCBackStyleTransparent = 0
CCBackStyleOpaque = 1
End Enum
Public Enum CCLeftRightAlignmentConstants
CCLeftRightAlignmentLeft = 0
CCLeftRightAlignmentRight = 1
End Enum
Public Enum CCVerticalAlignmentConstants
CCVerticalAlignmentTop = 0
CCVerticalAlignmentCenter = 1
CCVerticalAlignmentBottom = 2
End Enum
Public Enum CCIMEModeConstants
CCIMEModeNoControl = 0
CCIMEModeOn = 1
CCIMEModeOff = 2
CCIMEModeDisable = 3
CCIMEModeHiragana = 4
CCIMEModeKatakana = 5
CCIMEModeKatakanaHalf = 6
CCIMEModeAlphaFull = 7
CCIMEModeAlpha = 8
CCIMEModeHangulFull = 9
CCIMEModeHangul = 10
End Enum
Public Enum CCRightToLeftModeConstants
CCRightToLeftModeNoControl = 0
CCRightToLeftModeVBAME = 1
CCRightToLeftModeSystemLocale = 2
CCRightToLeftModeUserLocale = 3
CCRightToLeftModeOSLanguage = 4
End Enum
-
Re: CommonControls (Replacement of the MS common controls)
In addition to what Semke stated please remove the WM_STYLECHANGED handler on those controls that have a WindowProcUserControlDesignMode function in it. (Recommended)
Also I put an IObjectSafety implementation on the controls. (Optional)
And also the controls in the Property Pages are replaced to support Unicode at design time. (Optional)
So in my case it is a little bit of work to migrate to OCX version. But of course you can skip the 2 last steps.
The 1. step however you should consider. (WM_STYLECHANGED)
And as side note I do also a little bit of cleanup in the OCX version. (e.g. VisualStyles.bas is reduced to what is necessary etc.)
-
Re: CommonControls (Replacement of the MS common controls)
Thanks semke , I followed what you provided and it worked . An essential step to add to the previous ones is that I changed the instances for all class modules to "GlobalMultiuse" . I will summarize the steps here
Steps for converting STDexe to Activex control project :
1- Open the STDexe project
2- Remove all forms
3- Change the project type to Activex control project
4- A message appears " the project (start mode) property has changed "
5- Set all user controls to public
6- Set all class modules instances to GlobalMultiuse .
7- Remove the line which loads the main form from Sub_main()
8-Remove this code from ComCtlsBase module, and put it in the ISubclass class module
Code:
#If False Then
Private OLEDropModeNone, OLEDropModeManual
Private CCAppearanceFlat, CCAppearance3D
Private CCBorderStyleNone, CCBorderStyleSingle, CCBorderStyleThin, CCBorderStyleSunken, CCBorderStyleRaised
Private CCBackStyleTransparent, CCBackStyleOpaque
Private CCLeftRightAlignmentLeft, CCLeftRightAlignmentRight
Private CCVerticalAlignmentTop, CCVerticalAlignmentCenter, CCVerticalAlignmentBottom
Private CCIMEModeNoControl, CCIMEModeOn, CCIMEModeOff, CCIMEModeDisable, CCIMEModeHiragana, CCIMEModeKatakana, CCIMEModeKatakanaHalf, CCIMEModeAlphaFull, CCIMEModeAlpha, CCIMEModeHangulFull, CCIMEModeHangul
Private CCRightToLeftModeNoControl, CCRightToLeftModeVBAME, CCRightToLeftModeSystemLocale, CCRightToLeftModeUserLocale, CCRightToLeftModeOSLanguage
#End If
Public Enum OLEDropModeConstants
OLEDropModeNone = vbOLEDropNone
OLEDropModeManual = vbOLEDropManual
End Enum
Public Enum CCAppearanceConstants
CCAppearanceFlat = 0
CCAppearance3D = 1
End Enum
Public Enum CCBorderStyleConstants
CCBorderStyleNone = 0
CCBorderStyleSingle = 1
CCBorderStyleThin = 2
CCBorderStyleSunken = 3
CCBorderStyleRaised = 4
End Enum
Public Enum CCBackStyleConstants
CCBackStyleTransparent = 0
CCBackStyleOpaque = 1
End Enum
Public Enum CCLeftRightAlignmentConstants
CCLeftRightAlignmentLeft = 0
CCLeftRightAlignmentRight = 1
End Enum
Public Enum CCVerticalAlignmentConstants
CCVerticalAlignmentTop = 0
CCVerticalAlignmentCenter = 1
CCVerticalAlignmentBottom = 2
End Enum
Public Enum CCIMEModeConstants
CCIMEModeNoControl = 0
CCIMEModeOn = 1
CCIMEModeOff = 2
CCIMEModeDisable = 3
CCIMEModeHiragana = 4
CCIMEModeKatakana = 5
CCIMEModeKatakanaHalf = 6
CCIMEModeAlphaFull = 7
CCIMEModeAlpha = 8
CCIMEModeHangulFull = 9
CCIMEModeHangul = 10
End Enum
Public Enum CCRightToLeftModeConstants
CCRightToLeftModeNoControl = 0
CCRightToLeftModeVBAME = 1
CCRightToLeftModeSystemLocale = 2
CCRightToLeftModeUserLocale = 3
CCRightToLeftModeOSLanguage = 4
End Enum
These steps are open for any modification and addition by anyone who finds them incomplete or missing some points to be added or mentioned
The previous steps are tested and the project works fine and I have not yet applied Krool`s steps . However , I am going to go on this advice and remove the exception until it is suitable time for krool to explain the reason for this step and the case which will raise a problem if these exceptions were not removed . Thanks all for help
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Hosam AL Dein
6- Set all class modules instances to GlobalMultiuse.
Wrong. Put all classes to "PublicNotCreatable".
Except CommonDialog.cls. This shall be "MultiUse". (Not "GlobalMultiUse")
Also some classes should kept "Private" such as Enumeration.cls, VTableSubclass.cls etc.
So an advise to put everything on GlobalMultiUse is not so good.
For the other stuff in WindowProcUserControlDesignMode it is a safety to remove subclassing in IDE at DesignTime. In the OCX this is not needed. If it keeps there it can even produce glitches. You had once an issue with the CommandButtonW that it went blank on certain steps. This was one case of that.
Anyhow, you can proceed how you want..
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Wrong. Put all classes to "PublicNotCreatable".
Except CommonDialog.cls. This shall be "MultiUse". (Not "GlobalMultiUse")
Also some classes should kept "Private" such as Enumeration.cls, VTableSubclass.cls etc.
So an advise to put everything on GlobalMultiUse is not so good.
For the other stuff in WindowProcUserControlDesignMode it is a safety to remove subclassing in IDE at DesignTime. In the OCX this is not needed. If it keeps there it can even produce glitches. You had once an issue with the CommandButtonW that it went blank on certain steps. This was one case of that.
Anyhow, you can proceed how you want..
thanks a lot krool for correction . Of course I will proceed in the way you provided . I will re-write these steps again until we come to the ideal way
-
Re: CommonControls (Replacement of the MS common controls)
OCX Version 1.5 now released.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
OCX Version 1.5 now released.
Thanks for the new release. Im using these controls in a new project. really appreciate your time and effort in these controls!
Was wondering if there would be any chance of being able to add a color option for tool bar button caption text.
thanks again.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
vbLewis
Thanks for the new release. Im using these controls in a new project. really appreciate your time and effort in these controls!
Was wondering if there would be any chance of being able to add a color option for tool bar button caption text.
thanks again.
You must have overlooked it. There is a ForeColor property available.
Code:
ToolBar1.Buttons(1).ForeColor
This can also be defined at design-time trough the property page.
-
Re: CommonControls (Replacement of the MS common controls)
ahh ok. yes i missed it, i was looking under the color tab and in the main toolbar properties. The fact that it is per button makes it even cooler! Thankyou!
Edit: I couldnt get any of the custom foreground colors to 'stick' from the property pages, only set from code, so far for toolbar button and status bar panels. is this by design?
-
Re: CommonControls (Replacement of the MS common controls)
Source code for both Std-EXE and ActiveX version has been put on GitHub. Link can be found on initial post.
Quote:
Originally Posted by
vbLewis
I couldnt get any of the custom foreground colors to 'stick' from the property pages, only set from code, so far for toolbar button and status bar panels. is this by design?
For me it works, so I cannot replicate your problem. What do you mean exactly? Please describe step-by-step.
-
Re: CommonControls (Replacement of the MS common controls)
Add toolbar control to form -> click on 'custom' to open custom property page dialog -> add toolbar button -> click on colored command button to change button foreground color -> select new color for button caption -> click OK -> color dialog closes and color on command button in property sheet stays the same as it was. same for font, cannot change size.
are you calling 'propertychanged()' when property is changed in in property sheet? it may be a storage bag permission problem on my end too.
when i use the normal toolbar properties tab in the IDE to change font, font size is changed and works ok. but of course it doesnt edit colors for a single button, only the entire toolbar. I can set color for individual buttons from code and works good that way.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
vbLewis
Add toolbar control to form -> click on 'custom' to open custom property page dialog -> add toolbar button -> click on colored command button to change button foreground color -> select new color for button caption -> click OK -> color dialog closes and color on command button in property sheet stays the same as it was. same for font, cannot change size.
are you calling 'propertychanged()' when property is changed in in property sheet? it may be a storage bag permission problem on my end too.
when i use the normal toolbar properties tab in the IDE to change font, font size is changed and works ok. but of course it doesnt edit colors for a single button, only the entire toolbar. I can set color for individual buttons from code and works good that way.
Update released. Please test again. Thanks
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
New Pager Problem
Try with the attached.
Attachment 153961
The problem is, when I modify a Pager's buddy, then the buddy gets clipped.
It is not with a PictureBox (discussed before), but with a standard UC.
EDIT:
A PictureBox as the buddy works ok with the workaround described in #1820.
Now I use this approach instead of using a UC as the buddy.
-
Re: CommonControls (Replacement of the MS common controls)
Krool,
I was just working with you VBFlexGrid Demo system and now that you have an OCX version I thought I would make the same sample program using the OCX file. I decided to make the two forms with your VBCCRxx OCX files and I just noticed that you didn't include a PictureBox in your VBCCRxx controls. Was that intentional and if so, why? I assume I can use the ImageList control to achieve the same results and I am guessing that's why you didn't do one for VBCCRxx but I thought I would ask.
-
Re: CommonControls (Replacement of the MS common controls)
MountainMan,
PictureBox replacement is not needed and there are also better alternatives, e.g. AlphaImageControl.
ImageList was necessary to work together with the controls.
-
Re: CommonControls (Replacement of the MS common controls)
Want to report a problem
RichTextBox can't do anything to clear up, if SelProtected is being used or the document is already contain SelProtected Text
BTW, thank you for this wonderful control!
-
Re: CommonControls (Replacement of the MS common controls)
TABSTRIP QUESTION
The TabClick events is fired immediately when the mouse button is down on the tab.
In other controls, like CommandButtonW, the click events is not fired until the mouse button is released over the control.
Any chance to improve this behavior for the TabStrip?
Karl
-
Re: CommonControls (Replacement of the MS common controls)
SUBCLASSING QUESTION (again)
In post #1814 Dex told me how to use the subclassing provided by VBCCR.
This works quite well.
But when we use the OCX and not the EXE version, this can't be done.
ComCtlsSetSubclass/ComCtlsRemoveSubclass is not avaiable.
Krool, is it possible to use your subclassing along with the OCX version?
And if, how?
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
The IDE (does not effect compiled exe) will not crash anymore when using VBCCRxx.OCX and VBFLXGRDxx.OCX in paralell. (Std-EXE version not concerned)
-
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
Hosam, do you use the most recent version or the former version?
If you use the most recent version, can you try the same with yesterday`s version?
Or the other way around?
Do you get the same result when you use the OCX?
-
Re: CommonControls (Replacement of the MS common controls)
thanks karl , here is the test for the ocx
https://youtu.be/sPcpaampZa4
-
Re: CommonControls (Replacement of the MS common controls)
here is a test with the most recent ocx and it is the same result
https://youtu.be/uooZxHBKV24