-
Sep 30th, 2017, 01:52 AM
#1801
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
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.
Changing .TextAlignment will cause re-creating of the control. During the re-creation LockWindowUpdate is used:
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.
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.
-
Sep 30th, 2017, 02:55 AM
#1802
Re: CommonControls (Replacement of the MS common controls)
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.
-
Sep 30th, 2017, 03:24 AM
#1803
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
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.
I won't switch back to WM_SETREDRAW.
Why should you?
-
Sep 30th, 2017, 04:10 AM
#1804
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
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
-
Oct 1st, 2017, 11:14 PM
#1805
Hyperactive Member
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?
Last edited by Mith; Oct 2nd, 2017 at 05:38 AM.
-
Oct 2nd, 2017, 05:48 AM
#1806
-
Oct 2nd, 2017, 07:01 AM
#1807
Re: List View "Right To Left" not work
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?
How is .RightToLeftMode set?
-
Oct 2nd, 2017, 09:33 AM
#1808
Hyperactive Member
Re: List View "Right To Left" not work
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
thx for the hint!
Last edited by Mith; Oct 2nd, 2017 at 09:40 AM.
-
Oct 3rd, 2017, 05:06 PM
#1809
-
Oct 4th, 2017, 03:02 AM
#1810
Hyperactive Member
Re: No unicode support at the list view event "OLEDragDrop"
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
-
Oct 4th, 2017, 05:13 AM
#1811
Re: No unicode support at the list view event "OLEDragDrop"
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
-
Oct 4th, 2017, 06:50 AM
#1812
Hyperactive Member
Re: No unicode support at the list view event "OLEDragDrop"
Originally Posted by Krool
How about we implement this inside VBCCR14.OCX to support unicode at the OLEDragDrop-event for all controls?
-
Oct 5th, 2017, 06:01 AM
#1813
Fanatic Member
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).
-
Oct 5th, 2017, 12:10 PM
#1814
Re: CommonControls (Replacement of the MS common controls)
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
Last edited by DEXWERX; Oct 5th, 2017 at 12:38 PM.
-
Oct 5th, 2017, 01:16 PM
#1815
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
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.
-
Oct 6th, 2017, 03:57 AM
#1816
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
PAGER PROBLEMS
See attached project.
Pager.zip
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
-
Oct 6th, 2017, 09:36 PM
#1817
-
Oct 6th, 2017, 11:06 PM
#1818
Hyperactive Member
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
-
Oct 7th, 2017, 11:26 AM
#1819
New Member
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
-
Oct 8th, 2017, 02:14 PM
#1820
Re: CommonControls (Replacement of the MS common controls)
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
-
Oct 9th, 2017, 02:22 AM
#1821
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
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.
Last edited by Karl77; Oct 9th, 2017 at 09:18 AM.
-
Oct 9th, 2017, 04:51 AM
#1822
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
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...
Maybe krool can check if this is a bug inside his code or a MS-related problem...
Last edited by Mith; Oct 9th, 2017 at 04:53 AM.
Reason: attached pic was not showed at the msg
-
Oct 10th, 2017, 07:43 PM
#1823
Hyperactive Member
-
Oct 12th, 2017, 07:29 AM
#1824
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.
-
Oct 12th, 2017, 07:46 PM
#1825
Frenzied Member
Re: CommonControls (Replacement of the MS common controls)
ListBoxW etc. is lack of DataMember, DataSource, DataFeild,DataFormat properties... Can you implement those like VBFlexGrid?
-
Oct 14th, 2017, 08:46 PM
#1826
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
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!
-
Oct 20th, 2017, 05:53 PM
#1827
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.
-
Oct 26th, 2017, 06:42 PM
#1828
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.
-
Oct 26th, 2017, 10:23 PM
#1829
Fanatic Member
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
Last edited by Tech99; Oct 26th, 2017 at 10:54 PM.
-
Oct 27th, 2017, 11:31 AM
#1830
Re: CommonControls (Replacement of the MS common controls)
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.
-
Nov 4th, 2017, 12:04 AM
#1831
Addicted Member
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 .
-
Nov 4th, 2017, 05:42 AM
#1832
Addicted Member
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.
-
Nov 4th, 2017, 01:29 PM
#1833
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
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
what is missed here?
-
Nov 4th, 2017, 01:54 PM
#1834
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.
-
Nov 4th, 2017, 02:24 PM
#1835
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
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.
-
Nov 5th, 2017, 06:49 AM
#1836
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
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
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 ?
-
Nov 5th, 2017, 02:33 PM
#1837
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
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 .
-
Nov 6th, 2017, 10:43 AM
#1838
Lively Member
Re: CommonControls (Replacement of the MS common controls)
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
Last edited by Semke; Nov 6th, 2017 at 10:51 AM.
-
Nov 6th, 2017, 01:14 PM
#1839
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.)
-
Nov 7th, 2017, 08:01 AM
#1840
Addicted Member
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
Last edited by Hosam AL Dein; Nov 7th, 2017 at 08:06 AM.
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
|