-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
I can't find the OLEDragDrop event in the VBCCR17.RichTextBox (it's exposed in other VBCCR17 controls). There's instead a OLEDragDrop property that should enable the window as a OLE drop target but it doesn't actually do it here. What am I doing wrong? Or is there a workaround for this? If there is one, can anyone provide an example? Thanks !
I'm running the VB6 Ide sp5 & 6 in a 64 bit Windows 10 OS.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
@jpfa
You are right, some events are missing at Krool's Richtextbox control. Maybe Krool forgot to implement them?
Microsoft Richtetxbox events:
Code:
Private Sub mS_RichTextBox_OLECompleteDrag(Effect As Long)
Private Sub mS_RichTextBox_OLEDragDrop(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
Private Sub mS_RichTextBox_OLEDragOver(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer)
Private Sub mS_RichTextBox_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
Private Sub mS_RichTextBox_OLESetData(Data As RichTextLib.DataObject, DataFormat As Integer)
Private Sub mS_RichTextBox_OLEStartDrag(Data As RichTextLib.DataObject, AllowedEffects As Long)
VBCCR17 Richtextbox events:
Code:
Private Sub VBCCR_RichTextBox_OLECompleteDrag()
Private Sub VBCCR_RichTextBox_OLEContextMenuClick(ByVal ID As Long)
Private Sub VBCCR_RichTextBox_OLEDeleteObject(ByVal LpOleObject As Long)
Private Sub VBCCR_RichTextBox_OLEGetContextMenu(ByVal SelType As Integer, ByVal LpOleObject As Long, ByVal SelStart As Long, ByVal SelEnd As Long, hMenu As Long)
Private Sub VBCCR_RichTextBox_OLEGetDropEffect(Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Private Sub VBCCR_RichTextBox_OLEStartDrag(AllowedEffects As Long)
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
For now I'm processing the clipboard myself like this, but it's not elegant. I'd like to use OLE events provided by the control itself.
Code:
Private WithEvents cIDT As cDropTarget
Private Sub Form_Load()
txtSrt.OLEDragDrop = False
Set cIDT = New cDropTarget
cIDT.Attach txtSrt.hWnd
End Sub
Private Sub cIDT_Drop(pDataObj As oleexp.IDataObject, grfKeyState As Long, ptx As Long, pty As Long, pdwEffect As oleexp.DROPEFFECTS)
Dim Fmt As FORMATETC
Fmt.cfFormat = CF_HDROP
Fmt.TYMED = TYMED_HGLOBAL
Fmt.dwAspect = DVASPECT_CONTENT
Fmt.lindex = -1
Dim stg As STGMEDIUM
If pDataObj.QueryGetData(Fmt) = S_OK Then
pDataObj.GetData Fmt, stg
Dim nFiles As Long, sFiles() As String
Dim i As Long
Dim sBuffer As String
nFiles = DragQueryFileW(stg.data, &HFFFFFFFF, 0, 0)
If nFiles > 0 Then
ReDim sFiles(nFiles - 1)
For i = 0 To nFiles - 1
SysReAllocStringLen VarPtr(sBuffer), , DragQueryFileW(stg.data, i)
DragQueryFileW stg.data, i, StrPtr(sBuffer), Len(sBuffer) + 1&
sFiles(i) = sBuffer
Next
TxtSrtDroppedFiles sFiles, ScaleY(ptx, vbPixels, vbTwips), grfKeyState, pdwEffect
End If
Else
Debug.Print "failed querygetdata"
End If
pdwEffect = DROPEFFECT_NONE
End Sub
Private Sub TxtSrtDroppedFiles(Files() As String, ByVal y As Single, ByVal Shift As Long, Effect As oleexp.DROPEFFECTS)
Dim FileName As Variant
Effect = DROPEFFECT_COPY
For Each FileName In Files
MsgBoxW FileName
Next
DoEvents
End Sub
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
@jpfa
You are right, some events are missing at Krool's Richtextbox control. Maybe Krool forgot to implement them?
Microsoft Richtetxbox events:
Code:
Private Sub mS_RichTextBox_OLECompleteDrag(Effect As Long)
Private Sub mS_RichTextBox_OLEDragDrop(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
Private Sub mS_RichTextBox_OLEDragOver(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer)
Private Sub mS_RichTextBox_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
Private Sub mS_RichTextBox_OLESetData(Data As RichTextLib.DataObject, DataFormat As Integer)
Private Sub mS_RichTextBox_OLEStartDrag(Data As RichTextLib.DataObject, AllowedEffects As Long)
VBCCR17 Richtextbox events:
Code:
Private Sub VBCCR_RichTextBox_OLECompleteDrag()
Private Sub VBCCR_RichTextBox_OLEContextMenuClick(ByVal ID As Long)
Private Sub VBCCR_RichTextBox_OLEDeleteObject(ByVal LpOleObject As Long)
Private Sub VBCCR_RichTextBox_OLEGetContextMenu(ByVal SelType As Integer, ByVal LpOleObject As Long, ByVal SelStart As Long, ByVal SelEnd As Long, hMenu As Long)
Private Sub VBCCR_RichTextBox_OLEGetDropEffect(Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Private Sub VBCCR_RichTextBox_OLEStartDrag(AllowedEffects As Long)
True.
OLEDragDrop is RichText specific.
Will implement OLEDropMode and OLEDrag in 1.8. (Can be used if OLEDragDrop is False only for back-compat)
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
True.
OLEDragDrop is RichText specific.
Will implement OLEDropMode and OLEDrag in 1.8. (Can be used if OLEDragDrop is False only for back-compat)
Thanks, Krool!
-
1 Attachment(s)
ComboBoxW text replacing bug
I found a bug at the ComboBoxW control using the style "dropdowncombo", all other control properties are "Standard".
I get different results for the text property when using this code:
Code:
cboMS.Text = "C:\test_"
cboMS.AddItem "C:\test_1"
cboMS.AddItem "C:\data"
cboVBCCR.Text = "C:\test_"
cboVBCCR.AddItem "C:\test_1"
cboVBCCR.AddItem "C:\data"
Attachment 189513
The command .AddItem "C:\test_1" replaces the text "C:\test_" in the editbox!
AddItem should extend the dropdown-list but not replace the text in the editbox.
When i manually change the text in the editbox to "C:\test_" and open the dropdown-list the text will be changed back to "C:\test_1" again without clicking on the first item in the dropdown-list!
Any idea how to get the same behavior as the original MS controls?
-
Re: ComboBoxW text replacing bug
Quote:
Originally Posted by
Mith
I found a bug at the ComboBoxW control using the style "dropdowncombo", all other control properties are "Standard".
I get different results for the text property when using this code:
Code:
cboMS.Text = "C:\test_"
cboMS.AddItem "C:\test_1"
cboMS.AddItem "C:\data"
cboVBCCR.Text = "C:\test_"
cboVBCCR.AddItem "C:\test_1"
cboVBCCR.AddItem "C:\data"
Attachment 189513
The command .AddItem "C:\test_1" replaces the text "C:\test_" in the editbox!
AddItem should extend the dropdown-list but not replace the text in the editbox.
When i manually change the text in the editbox to "C:\test_" and open the dropdown-list the text will be changed back to "C:\test_1" again without clicking on the first item in the dropdown-list!
Any idea how to get the same behavior as the original MS controls?
That's really strange.
If you do
Code:
cboMS.Text = "C:\test_"
cboMS.AddItem "C:\test_1"
cboMS.AddItem "C:\data"
cboMS.Width = cboMS.Width + 30
You get the same behavior in the MS combo box.
The problem is in the CheckDropDownHeight handler where MoveWindow is used..
Workaround could be to block LB_FINDSTRING in the list windowproc during that MoveWindow.
EDIT: Found a solution to use SetWindowPos on the list handle directly upon CheckDropDownHeight. Will roll out the fix release soon.
-
Re: ComboBoxW text replacing bug
Quote:
Originally Posted by
Mith
I found a bug at the ComboBoxW control using the style "dropdowncombo", all other control properties are "Standard".
I get different results for the text property when using this code:
Code:
cboMS.Text = "C:\test_"
cboMS.AddItem "C:\test_1"
cboMS.AddItem "C:\data"
cboVBCCR.Text = "C:\test_"
cboVBCCR.AddItem "C:\test_1"
cboVBCCR.AddItem "C:\data"
Attachment 189513
The command .AddItem "C:\test_1" replaces the text "C:\test_" in the editbox!
AddItem should extend the dropdown-list but not replace the text in the editbox.
When i manually change the text in the editbox to "C:\test_" and open the dropdown-list the text will be changed back to "C:\test_1" again without clicking on the first item in the dropdown-list!
Any idea how to get the same behavior as the original MS controls?
Update released. Fixed.
-
Re: ComboBoxW text replacing bug
Quote:
Originally Posted by
Krool
Update released. Fixed.
The problem with .AddItem is fixed with the new update.
But when i open the dropdown-list the text still got replaced.
It looks like after opening the drop-down list, some kind of "autocomplete" is triggered and the control searches all items for a match to the text and then replaces it.
Any idea how to deactivate the auto-complete feature?
-
Re: ComboBoxW text replacing bug
Quote:
Originally Posted by
Mith
The problem with .AddItem is fixed with the new update.
But when i open the dropdown-list the text still got replaced.
It looks like after opening the drop-down list, some kind of "autocomplete" is triggered and the control searches all items for a match to the text and then replaces it.
Any idea how to deactivate the auto-complete feature?
The MS control behaves the same. This "feature" can be deactivated by only blocking LB_FINDSTRING and returning -1.
-
Re: ComboBoxW text replacing bug
Quote:
Originally Posted by
Krool
The MS control behaves the same. This "feature" can be deactivated by only blocking LB_FINDSTRING and returning -1.
Is it possible for you to add a new "AutoComplete" property (true/false) for this case?
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
I think I found another problem on the RichTextBox: the comands in the context menu Replace, Copy, Paste don't seem to support Unicode. Maybe the problem lies in my code. I'll perform more tests. Anyway, I think I can work around this issue by supplying a custom context menu instead of using the default one. However, it would be nice to have complete Unicode support provided natively by the control.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
jpfa
I think I found another problem on the RichTextBox: the comands in the context menu Replace, Copy, Paste don't seem to support Unicode.
My RichTextBox doesnt have a context menu for Replace, Copy & Paste (Win10). I had to code my own context menu (with unicode support).
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
My RichTextBox doesnt have a context menu for Replace, Copy & Paste (Win10). I had to code my own context menu (with unicode support).
My version of VBCCR17.OCX is:
Control ActiveX 1.7.0.44 VBCCR17 1.07.0044
5,31 MB 30/08/202213:48
Is yours rhe same?
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
jpfa
My version of VBCCR17.OCX is:
Control ActiveX 1.7.0.44 VBCCR17 1.07.0044
5,31 MB 30/08/202213:48
Is yours rhe same?
My VBCCR version is 1.7.80.
I only know that you can activate the property "Autoverbmenu" at the MS RichTextBox to get the system context menu.
But the VBCCR RichTextBox doesnt have this property.
How did you activate the context menu?
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
How did you activate the context menu?
I didn't do it on purpose and I can't seem to find anything in my code related to that behavior.
This is an old project (maybe from 2008 or so) that I'm updating to support Unicode. Could it be that some hidden leftover from the old project is triggering it?
I just started a new project to test this. I didn't write any code; just used the default main form and placed a VBCCR17.RichTextBox in it. I can confirm that it doesn't expose a context menu, just like you said. I don't have a clue about why.
I guess I'll have to a lot more testing to shed some light over this mystery. Maybe you can give me some pointers?
What I use to do in situations like this is to start a new project setting the components and references as used in the old project and copy all the code into it; then I see if the weird behavior is present here too. If it isn't and the Guids of the components are the same as in the old project, I'll be lost. If it is present then I comment out the code a piece at a time until the weird behavior desapears.
This may take some time and I don't know if it's worth the effort. I may just implement a custom context menu, like you did. Speaking of which, if you're willing to share your code it will spare me some coding effort. I'd appreciate that. I planned to override the default menu anyway so to include some specialized commands in it.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
jpfa
I guess I'll have to a lot more testing to shed some light over this mystery. Maybe you can give me some pointers?
check the mouse click events for some code to display a context menu.
Quote:
Originally Posted by
jpfa
Speaking of which, if you're willing to share your code it will spare me some coding effort.
Sorry, i can't, because im using a commercial control for the context menu.
Maybe useful for you: https://www.vbforums.com/showthread....dows-clipboard
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
check the mouse click events for some code to display a context menu.[/url]
Sure! Why didn't I do that first thing? That's what I usualy do. I must have been too sleepy last night.
Quote:
Originally Posted by
Mith
Sorry, i can't, because im using a commercial control for the context menu.
[/url]
That's totally fair. I'll post my code when I get it done.
Quote:
Originally Posted by
Mith
Sure! That's what I had planned to use. I'm already using part of that code for the Ole drag drop event replacement and it works as expected.
Thanks for your help!
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Update:
I found the bug in my code: I had already implemented a custom context menu that I was sure I wasn't using anymore but actually it was still active. That code didn't support Unicode.
I just added Unicode support to it using https://www.vbforums.com/showthread....=1#post5067907 for the Clipboard and TextBoxW in the "Replace" form I already had instead of VB6 native TextBox. So I won't post my code because I didn't write any myself; it's all in the posted link.
Thanks again Mith for your help!
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
@jpfa
You are right, some events are missing at Krool's Richtextbox control. Maybe Krool forgot to implement them?
Microsoft Richtetxbox events:
Code:
Private Sub mS_RichTextBox_OLECompleteDrag(Effect As Long)
Private Sub mS_RichTextBox_OLEDragDrop(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
Private Sub mS_RichTextBox_OLEDragOver(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer)
Private Sub mS_RichTextBox_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
Private Sub mS_RichTextBox_OLESetData(Data As RichTextLib.DataObject, DataFormat As Integer)
Private Sub mS_RichTextBox_OLEStartDrag(Data As RichTextLib.DataObject, AllowedEffects As Long)
VBCCR17 Richtextbox events:
Code:
Private Sub VBCCR_RichTextBox_OLECompleteDrag()
Private Sub VBCCR_RichTextBox_OLEContextMenuClick(ByVal ID As Long)
Private Sub VBCCR_RichTextBox_OLEDeleteObject(ByVal LpOleObject As Long)
Private Sub VBCCR_RichTextBox_OLEGetContextMenu(ByVal SelType As Integer, ByVal LpOleObject As Long, ByVal SelStart As Long, ByVal SelEnd As Long, hMenu As Long)
Private Sub VBCCR_RichTextBox_OLEGetDropEffect(Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Private Sub VBCCR_RichTextBox_OLEStartDrag(AllowedEffects As Long)
The RichTextBox control is now updated. Can you check if everything is fine ? To note is that of course only the Std-EXE version is updated. The OCX will be updated in a year or so when more updates got accumulated.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Thanks, Krool! It'll take some days to have time to test the update. Also I'm affraid my tests will be quite shallow (my coding skills are rather poor). So far I've only used the ocx control. I hope using the exe won't be hard and the debugger stepping into your subclassing can be avoided. Else my tests will be even more shallow. I wish somone else will join me in the testing.
Meanwhile I had an issue with the Common Dialog replacement: the FileValidate event isn't firing. I just stumbled on this and didn't have time for further testing. This is most likely a bug in my code. I'll test the RichTextBox update first, though. The FileValidate issue can wait. Anyway this probably wouldn't help with what I wanted to achieve: to be able to accept an empty filename as valid (allowing the OK button to close the dialog even in this case).
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
jpfa
Thanks, Krool! It'll take some days to have time to test the update. Also I'm affraid my tests will be quite shallow (my coding skills are rather poor). So far I've only used the ocx control. I hope using the exe won't be hard and the debugger stepping into your subclassing can be avoided. Else my tests will be even more shallow. I wish somone else will join me in the testing.
Meanwhile I had an issue with the Common Dialog replacement: the FileValidate event isn't firing. I just stumbled on this and didn't have time for further testing. This is most likely a bug in my code. I'll test the RichTextBox update first, though. The FileValidate issue can wait. Anyway this probably wouldn't help with what I wanted to achieve: to be able to accept an empty filename as valid (allowing the OK button to close the dialog even in this case).
MSDN
Quote:
The system sends this notification only if the dialog box was created using the OFN_EXPLORER value.
Did you use CdlOFNExplorer in the .Flags property ?
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Thanks, Krool! I wasn't aware of that. That must be it. I didn't set the CdlOFNExplorer flag because I thought the new style was enabled by default. I didn't realize CdlOFNExplorer could have other effects. I still have so much to learn!
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
I have been reading thru the post, ( I have not got thru all of them yet), but was wondering if anybody knows if there is a replacement OCX for Media player. I have been scouring the internet, but have not found one yet. I have an Old program I wrote years ago that uses Media Player, and I would really love to get that program re going again.
Thanks in advance,
Susan Grant
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
The RichTextBox control is now updated. Can you check if everything is fine ? To note is that of course only the Std-EXE version is updated. The OCX will be updated in a year or so when more updates got accumulated.
I tested the updated ComCtlsDemo. The new events seem to work OK. It was a very shallow test; just added some Debug.Print to the events to display the values of the arguments and triggered the events.
I didn't dare to add the source code to my projects. I'll wait for a new release of the OCX. Since I'm already using a workaround I may even skip some releases.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
grantsr1
I have been reading thru the post, ( I have not got thru all of them yet), but was wondering if anybody knows if there is a replacement OCX for Media player. I have been scouring the internet, but have not found one yet. I have an Old program I wrote years ago that uses Media Player, and I would really love to get that program re going again.
Thanks in advance,
Susan Grant
I still use the Windows Media Player in my project. Works from Win7 to Win11 including events.
Example for late binding:
Code:
Private WithEvents xWMP As WMPLib.WindowsMediaPlayer
Private MPlayer As VBControlExtender
Set MPlayer = Controls.Add("WMPlayer.OCX.7", "MPlayer4")
Set xWMP = MPlayer.Object
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Quote Originally Posted by jpfa
Meanwhile I had an issue with the Common Dialog replacement: the FileValidate event isn't firing. I just stumbled on this and didn't have time for further testing. This is most likely a bug in my code. I'll test the RichTextBox update first, though. The FileValidate issue can wait. Anyway this probably wouldn't help with what I wanted to achieve: to be able to accept an empty filename as valid (allowing the OK button to close the dialog even in this case).
Quote:
Originally Posted by
Krool
MSDN
Did you use CdlOFNExplorer in the .Flags property ?
I did a few tests using CdlOFNExplorer in the .Flags property. None of the events were triggered. I did the tests on a barebones app in the Ide. I didn't test a compiled exe. I did the tests in 2 different machines both running Windows 10 22H2. Same results.
So I switched to using the CmnDialogEx.cls class by LaVolpe in my projects. It behaves as expected and adds additional functionality which I already found useful.
Anyway the CmnDialogEx.cls classdidn't help with what I wanted to achieve: to be able to accept an empty filename as valid (allowing the OK button to close the dialog even in this case). The DialogOnFileOk event isn't triggered if the filename is empty.
I was able to device a workaround for an issue I had like forever: the file CommonDialog locks the last selected folder (even if I hit Cancel) forbiding me to delete it. This happens with all of the flavors of file CommonDialog I've tested (MS's, yours, LaVolpe's). The workaround is to select a different folder (I used App.Path) on a 2nd call to ShowOpen/ShowSave immediately after the first, and calling CloseDialog inside the DialogOnInit event of this 2nd call to ShowOpen/ShowSave. The dialog window flickers on this 2nd call, but this is just a small price to pay.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Krool,
I have a question about the ListView control. You have an event raised when the left mouse button is down along with the shift status. There is a similar event for a right click. I would like to be able to detect when the user scrolls the mouse wheel with or without shift keys while inside the ListView control. I can't find any of the events that might cover this. Am I overlooking something? If not, could this be added fairly easily? Thanks.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
MountainMan
I would like to be able to detect when the user scrolls the mouse wheel with or without shift keys while inside the ListView control.
You have to use subclassing: https://www.vbforums.com/showthread....e-wheel-in-VB6
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
That's what I have been doing. I was hoping that the subclassing was already built in to your code. Thanks.
-
1 Attachment(s)
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Krool,
I am having a problem with events MouseEnter and MouseLeave not ever firing in ListView. Atached i a simple example. When the mouse enters or leaves the form's Listview control, there should be a beep but there is nothing. The event subroutines are never called. However, the MouseDown event fires properly and I have the code beep when a button is pressed inside ListView.
Am I doing something wrong or is there a bug in the code? Thanks.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
MountainMan
I am having a problem with events MouseEnter and MouseLeave not ever firing in ListView.
Set the control property MouseTrack=True to use the these events.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Updated manifest applying the miscStatus* attributes. Thanks to wqweto.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
OCX 1.8 released.
Thanks for your continued support and development of these controls Krool!
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
OCX 1.8 released.
Hello Krool, thank you for your great tool, if you add GotFocus color and LostFocus, it will be great (In the TextBoxW1 control)
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
It's been a long time since I've tried using the OCX version, so I forgot how I registered it last time.
VB6 can't automatically register it (Error: Not registerable as an ActiveX component)
And dropping on SysWOW64\regsvr32.exe fails (DllRegisterServer 0x80004005 for VBCCR18, 'check if its even 32bit' on VBCCR17-- no, it's not tB compiled 64bit ocx, it's the same 32bit VB6-compiled one i had on my old machine).
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mojtaba
Hello Krool, thank you for your great tool, if you add GotFocus color and LostFocus, it will be great (In the TextBoxW1 control)
It's easy to change backcolor or forecolor upon those events. VBCCR18 will now be "as is". Bugs will be fixed of course.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
fafalone
It's been a long time since I've tried using the OCX version, so I forgot how I registered it last time.
VB6 can't automatically register it (Error: Not registerable as an ActiveX component)
And dropping on SysWOW64\regsvr32.exe fails (DllRegisterServer 0x80004005 for VBCCR18, 'check if its even 32bit' on VBCCR17-- no, it's not tB compiled 64bit ocx, it's the same 32bit VB6-compiled one i had on my old machine).
I can't repro. Had on multiple environments no problems.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Returning to VB6 programming after a long break, I decided to undertake the task of replacing my current implementation of controls with VBCCR (I already use VBFLXGRD since ver. 1.4) and after several days of handy work switching between my text editor and the VB6 IDE I have completed the whole thing without any direct issues. However, there are a few differences between my old and the new VBCCR1.8 controls I'm not sure how to address e.g. making structural changes to my code or make a request for function enhancement. I post here as I'm using the OCX version although I'm aware of that stuff gets implemented in the Std-Exe version first.
From what I've been able to conclude so far there are currently 3 things I am missing in the VBCCR18 controls:
1. A ListIndexChange() Event in the Combo- and ListBox controls, which is useful as it allows for differentiation between if the index changed due to the user clicked an item in the control or if it changed due to programmatic reasons.
2. In the ComboBox only, a BeginEdit() and EndEdit() Events which fires when user starts typing in Edit portion of controls and finishes the edit operation. The EndEdit Event may come with several arguments, like a boolean for if a change really took place, a string for the new value and reason for the end (eg. user pressed return, focus was killed, Escape pressed, control was dropped), the Index may also be useful to get.
3. The ability for Label control to render some HTML assigned to the Caption, or a dedicated HtmlCaption, property. Doesn't need to be full fetched html just the most common and useful formatting stuff. Well, doesn't need to be html, that's just what my old control offered, but the idea is that you can have a ready made html formatted string w/ placeholders to fill from code and display in a typical "label situation".
Maybe there is such a control already but I haven't been able to find any here. The Combo and Listbox functionalities are more important to me though, so question is if this is something that could be added to the control suite or not?
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Feature request: it would be nice to include different underline styles like wave, double underline, etc. I think it is quite easy to include (but my apologies if I am wrong), because now I accomplish it this way:
Code:
Dim iStart As Long
Dim iLen As Long
iStart = rtfTest.SelStart
iLen = rtfTest.SelLength
rtfTest.SelUnderline = True
rtfTest.SelColor = vbRed
rtfTest.SelRTF = Replace(rtfTest2.SelRTF, "\ul", "\ulwave")
rtfTest.SelStart = iStart
rtfTest.SelLength = iLen
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Hi krool,
im still using VBCCR v1.7.104 and want to upgrade to v1.8.x
Is the upgrade as simple as unregister v1.7 and register v1.8 to continue with my vb-projects?
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
Hi krool,
im still using VBCCR v1.7.104 and want to upgrade to v1.8.x
Is the upgrade as simple as unregister v1.7 and register v1.8 to continue with my vb-projects?
Yes it should be very smooth from 1.7 to 1.8.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Yes it should be very smooth from 1.7 to 1.8.
It doesnt work. I unregister v1.7 and registered v1.8. After i started one project i got error messages about the missing v1.7...
I replaced the v1.7 with v1.8 in the main vbp file but after loading the project again i got error messages for each form in the project...
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
It doesnt work. I unregister v1.7 and registered v1.8. After i started one project i got error messages about the missing v1.7...
I replaced the v1.7 with v1.8 in the main vbp file but after loading the project again i got error messages for each form in the project...
Yes the uuid needs to be replaced in each form.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Yes the uuid needs to be replaced in each form.
And all v1.7 references in the code! e.g. "Dim NodeX As VBCCR17.LvwListItem".
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Instructions to upgrade v1.7 to v1.8:
1. Don't unregister v1.7, so no-converted projects and compiled exe files will still work
2. Register v1.8
3. Use the free app OCX updater to convert your project: https://10tec.com/vb6-project-references-update/
4. Optional: edit your project manifest and replace v1.7 with v1.8 (see VBCCR18SideBySide.res)
5. Open your project and hit CTRL+F5 to test the code changes.
6. Compile your project and run the compiled exe.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
There is no guide on how to make an isolated ocx, I would like to add a background image to the richTextBox, and I don't want to compile all the ocx into one, I have tried to open a usercontrol, add the RichTextBox.ctl, the RichTextBoxBase.bas and the PPRichTextBoxGeneral.pag, I click on create the modified Ocx, and all are errors... Declarations are missing and I don't know what else...
Is there not a guide, please, to be able to convert and modify from VB6 any of the ocx in particular?
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
James Reynolds
There is no guide on how to make an isolated ocx, I would like to add a background image to the richTextBox, and I don't want to compile all the ocx into one, I have tried to open a usercontrol, add the RichTextBox.ctl, the RichTextBoxBase.bas and the PPRichTextBoxGeneral.pag, I click on create the modified Ocx, and all are errors... Declarations are missing and I don't know what else...
Why dont you add the missing declarations to your new project? Or use the original VBCCR source code and remove all controls you dont need...
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
Why dont you add the missing declarations to your new project? Or use the original VBCCR source code and remove all controls you dont need...
Sorry Mitch, I solutioned yesterday in the night, fault some bas archives... Thanks for your answer!!!
Another question, ChatGPT, although he is terrible at writing code according to my criteria, because he asks very simple things and I go on and on and on, and then I find a much simpler solution here or by writing code myself, an example, I asked him how to make a richTextBox be completely Locked, not enabled = false, because then the color of the letters changes, and after a lot of thinking, the solution was very simple, in the GotFocus event, set SetFocus to another control, and the nonsense was over, not cursor into the richtextbox, no blink into the control, nothing all...
But I found the solution myself, ChatGPT messing around in many places, and when I see that it's going crazy, I come back here or I try to program it myself...
But well, as a database for information on things that are not very complex, ChatGPT it is quite useful, and I asked him some time ago if Google Translate could be easily integrated into VB6, in the browser, and he told me not much, and well, but he gave me information on how to translate online from VB6, and I wonder, an idea for Krool:
Quote:
WHY NOT INCLUDE THAT CAPABILITY IN THE LABELW, COMBOW, LISTW, ETC...???
And wouldn't there be some TTS that could be included?
What about having, for example, properties like LangFrom and LangTo, TextFrom and TextTo and ShowTextFromOrTo in unicode controls that translate internally?
It wouldn't work to translate deep philosophy, but for many programs they are very simple things, in the labelw for example, they are usually very simple words that are put, and having a translation for any language that is spoken in Langto, can be of great convenience when making a multilingual program!!!
And there also has to be a way to include - although perhaps more complex because of having to include many TTS voices from many languages, that can already be a big handicap - some TTS...
It would be a luxury to have these options, at least the internal translation, then I'll look at what ChatGPT told me about how to translate from VB6 and I'll put it here - ChatGPT paid, it's 20US$ per month, it's not much really, it's useful (although not very useful at all) -...
Greetings, how do you see it?
-
1 Attachment(s)
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
I just finished converting native vb6 controls to VBCCR18.
While the VBCCR18 controls indeed display chinese characters properly, their ToolTipText property shows ? instead of foreign (e.g. Chinese) characters.
Is this a known issue?
Attachment 193484
-
2 Attachment(s)
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
The CommonDialog suffers from a similar problem.
As shown in the image below, it allows selection of a file name with Chinese characters:
Attachment 193489
But it returns a mangled FileName (?? instead of UNICODE characters):
Attachment 193490
And testing if that mangled FileName exists returns False.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Condor3,
The ToolTipText property is VB6's ToolTipText property and thus is still ANSI. It is easy to deploy your own tooltip.
Regarding the CommonDialog. The attachements do not work. Also I can't replicate your issue. For me the returned file name has the unicode chars in it.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Thanks, Krool!
I updated the post above to show the images. The code I'm using boils down to:
Code:
Dim gcdg As VBCCR18.CommonDialog
Set gcdg = New VBCCR18.CommonDialog
gcdg.flags = CdlOFNFileMustExist Or CdlOFNAllowMultiSelect Or CdlOFNExplorer
gcdg.Filter = "Crystal Reports (*.rpt;*.rpz)|*.rpt;*.rpz|Excel Files (*.xlsx;*.xls)|*.xlsx;*.xls|SQL Files (*.sql)|*.sql"
gcdg.FilterIndex = 1
gcdg.MaxFileSize = 32000
gcdg.ShowOpen
If FileExists(gcdg.FileName) Then ...
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
On the tooltip issue, please consider adding a UNICODE ToolTipW property to your controls.
For example, HexaGora controls maintain the old ToolTipText property (for backward compatibility, I assume).
But they also add a nice Tip property that supports UNICODE and other useful properties (such as Tip font size).
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Condor3
Thanks, Krool!
I updated the post above to show the images. The code I'm using boils down to:
Code:
Dim gcdg As VBCCR18.CommonDialog
Set gcdg = New VBCCR18.CommonDialog
gcdg.flags = CdlOFNFileMustExist Or CdlOFNAllowMultiSelect Or CdlOFNExplorer
gcdg.Filter = "Crystal Reports (*.rpt;*.rpz)|*.rpt;*.rpz|Excel Files (*.xlsx;*.xls)|*.xlsx;*.xls|SQL Files (*.sql)|*.sql"
gcdg.FilterIndex = 1
gcdg.MaxFileSize = 32000
gcdg.ShowOpen
If FileExists(gcdg.FileName) Then ...
I assume it's the FileExists function which does not support unicode. Can you post me your FileExists code?
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Thanks, Krool! I was using an ANSI method to check for FileExists.
Switching to a method that supports UNICODE fixed the problem.
-
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Condor3
Thanks, Krool! I was using an ANSI method to check for FileExists.
Switching to a method that supports UNICODE fixed the problem.
See here https://github.com/Kr00l/VBCCR/blob/...mon/Common.bas for a unicode FileExists function. To note is that GetAttr is "overloaded" as well in this Common.bas so that it supports unicode.
Also MsgBox is overloaded to support unicode. This way you can verify your FileName instead of debug.print which is obviously ANSI only.
-
3 Attachment(s)
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Problem: TextBoxW adds typed chars on left. Here is what I get when typing abc:
Attachment 193496
Relevant properties of the TextBoxW control:
Attachment 193497
Note that doing the same typing in a VBCCR18.RichTextBox works just fine:
Attachment 193498