Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Condor3
Ok, which region/locale do you have ?
Is it fixed when you set it to Off in the TextBoxW IMEMode property?
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Region: United States.
Language: English (United States). No other language installed.
Keyboard: English (United States)
Windows 10
Setting IMEMode to 2-CCEIMEModeOff doesn't solve the problem.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
When you right-click on the TextBoxW. Do you see right-to-left checked on the context menu?
1 Attachment(s)
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
No, that option is not checked:
Attachment 193500
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Do you have any code influencing the selection in the TextBoxW? Does it happen in a blank project? Does it happen on the VB.TextBox ?
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
All my TextBoxW (and RichTextBox) controls were converted to VBCCR18 by changing the references inside the .frm files.
I just tested adding a new TextBoxW control and it behaves fine!
So something about the converted TextBoxW controls is causing the problem.
This is surprising because the converted RichTextBox controls behave properly.
In terms of code impacting the selection in the control, the converted controls have Ole drag drop code like this:
Code:
Private Sub TextBoxW1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Data.GetFormat(vbCFUnicode) Then
TextBoxW1.SelText = Data.GetData(vbCFUnicode)
ElseIf Data.GetFormat(vbCFText) Then
TextBoxW1.SelText = Data.GetData(vbCFText)
End If
End Sub
But enabling manual drop and using the same code in the new TextBoxW control doesn't cause the problem.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
RTL typing Problem solved!
The Changed event of the TextBoxW called a function to update the tooltip. That function also Left-Trimmed the text:
Code:
TargetControl.Text = LTrim$(TargetControl.Text)
That line causes the TextBoxW to reverse typing direction. When commented out, problem is gone.
Thanks for your help in isolating this rather odd bug.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
During OLEDragOver of some text onto a TexBoxW, I need to display a cursor inside the target TextBoxW, reflecting the current dragging mouse position. The sample code located here, works fine with a regular textbox.
But with TextBoxW, the character position returned by the following code always returns 65535, instead of the correct character position under the mouse:
Code:
Public Function TextBoxCursorPos(ByVal txt As TextBoxW, ByVal X As Single, ByVal Y As Single) As Long
X = X \ Screen.TwipsPerPixelX
Y = Y \ Screen.TwipsPerPixelY
' Get the character number
TextBoxCursorPos = SendMessageStr(txt.hWnd, EM_CHARFROMPOS, 0&, CLng(X + Y * &H10000)) And &HFFFF&
End Function
Using a variation to avoid Twips to Pixels conversion makes no difference:
Code:
X = X \ 1
Y = Y \ 1
Please advise on how hovered-over character position in a TextBoxW control can be identified during OleDragOver event.
Thanks!
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Condor3
But with TextBoxW, the character position returned by the following code
always returns 65535, instead of the correct character position under the mouse:
Code:
Public Function TextBoxCursorPos(ByVal txt As TextBoxW, ByVal X As Single, ByVal Y As Single) As Long
X = X \ Screen.TwipsPerPixelX
Y = Y \ Screen.TwipsPerPixelY
' Get the character number
TextBoxCursorPos = SendMessageStr(txt.hWnd, EM_CHARFROMPOS, 0&, CLng(X + Y * &H10000)) And &HFFFF&
End Function
I guess you must use the unicode version of SendMessage:
Code:
Public Declare Function SendMessageW Lib "user32" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Good news! It worked with this variation:
Code:
TextBoxCursorPos = SendMessageW(txt.hWnd, EM_CHARFROMPOS, 0&, X \ Screen.TwipsPerPixelX) And &HFFFF&
Thanks, Mith!
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Simplified problem definition based on further troubleshooting:
Problem: TextBoxW control bound to MS Access via ADO returns wrong .SelStart (always as 0) on first-time lostFocus event. If user clicks back into the TextBoxW and then clicks away, causing another LostFocus event, the LostFocus returns the correct SelStart value.
Solution: Avoid the LostFocus event -- use the Validate event instead. While the LostFocus problem seems like a bug, I'm not going to chase this any further, now that I have a way around the problem.
Additional Info: the problem occurs only if there is no actual selection -- only cursor position. If there is an actual selection, .selStart is correct always.
Background: in the double-click event of a ListBoxW, I inserts the .Text property (text of double-clicked item in ListBoxW) into the TextBoxW control at the SelText position. I grab the selStart position in the LostFocus event of the TextBoxW because the .SelText property is not reliable when there is only a cursor position rather than an actual selection (even though the HideSelection property of the TextBoxW is set to False.
If I use code in the TextBoxW itself (debug.print the .SelStart in the clicked event of the TextBoxW itself), I get the correct value. So the problem occurs only when losing focus (1st time) or when accessing the .selStart property of the TextBoxW from another control (after the TextBoxW has lost focus).
Calling .SetFocus on the receiving TextBoxW from the double-clicked code in the ListBoxW does not solve the problem.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Hello,
RAR file in OP post is corrupt
Can you reup?
Thanks
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
I got it thanks, now I place the OCX in system directory but cannot register it.
Sorry. I just came back to VB after many years and having some hard time getting up to speed.
Thanks
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Perhaps you need to follow the ReadMe.txt about OLEGuids.tlb at the GitHub page.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Thank you I did it but where do I find the new controlsin the IDE. Should I activate these?
The control toolbar did not change
Thank you
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Press CTRL-T and check the desired components
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Having a hard time! The component is checked but no controls available so I try with th OCX and cannot register it and when I browse for it it doesnt appear in system32 dir even if I copy it in there. Not sure why. I got also some messages stating that vb cannot access windows registery.
Ive got luck with the OCX . I had to give admin acces to vb6.exe and after that it works. I should have think to that before. Thanks for the help! Merry Christmas.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
Thank you very much :)
I need to replace classic controls any utility which can replace with 100% accuracy. i need to replace all controls in my vb6 project.
Re: [VB6] ActiveX CommonControls (Replacement of the MS common controls)
i m confused why the tlbid and clsid used in regfree manifest are not the same as in tlb?
```[
uuid(6E079084-0EF6-40BD-AB06-AC31FE0BC00A),
version(1.2),
helpstring("VB Common Controls Replacement 1.8 Library"),
helpfile("__VB_HELP__"),
helpcontext(00000000)
]
[
uuid(EF21E8A7-E692-4A01-8189-595B39EBA0F6),
noncreatable
]
coclass Animation {
[default] dispinterface _Animation;
[default, source] interface __Animation;
};```