I changed the FontCombo now to FtcStyleDropDownCombo instead of FtcStyleDropDownList.
However, it would be interesting to know what FontName the RichTextBox has but the FontCombo did not load .. you know what I mean ?
Printable View
This is "MS Sans Serif". In my system it named "Microsoft Sans Serif".
wikipedia/Microsoft_Sans_Serif
https://www.vbforums.com/images/ieimages/2024/03/11.png
Yeah, but both are in the FontCombo... So, having FtcStyleDropDownList implies that the RichTextBox has a font which the FontCombo does not have in it's list, thus erroring. FtcStyleDropDownCombo will not error if it's not existing in the list. Can you re-check ?
Attachment 190718
PS: Both MS Sans Serif and Microsoft Sans Serif are valid and both should exist. MS Sans Serif is a bitmap font and Microsoft Sans Serif is a true-type font.
Not in my FontCombo. WinXP SP3 (edition 2021 from here).
https://www.vbforums.com/images/ieimages/2024/03/13.png
Should, but not must. This is a clean WinXP SP2 with MS Office 2002:
https://www.vbforums.com/images/ieimages/2024/03/14.png
Yahoo!!! I've found it!
Yes, this is not true-type font, so I've found it in a notepad...
https://www.vbforums.com/images/ieimages/2024/03/15.png
Update released.
Accelerator keys support in a VBA environment.
The same technique as in the VBFlexGrid control (which supports it already a while ago) is now implemented on each control where accelerator keys are applicable. (PreTranslateMsg)
To note is that this is a preparation for a future 1.8 OCX. This will not be implemented in the 1.7 OCX as it would be necessary to delete the .exd files in the VBE and Forms folder.
So, I decided to have it ready then for a fresh 1.8 someday.
Krool,
I am using the ListView control. It works great especially in virtual mode. However, I want to change the width of a column and I can't figure out how to do it. In the old ListView control you would use .Controls.item(x).Width = somevalue but your control does not have "Controls" or "Item()". I looked at your code for Get/Set ColumnWidth and you can set or get a Single that is the ColumnWidth but there doesn't seem to be any way to specify which column to use. I know it must be possible and probably easy but I can't figure out how to do it.
That works. Thanks!
Another question: I was surprised a while back that you got LabelW to have hWnd as a property. I didn't think much more about it until this week. When I run the debugger in VB6, I don't get any LabelW controls but I do get a lot of controls that look like and are named as labels but appear as TextBoxes. So it seems to me that you don't use the Label control and what we are calling LabelW's are actually restricted TextBoxes that appear as labels and that is how you can get an hWnd for a label. Is this correct?
I'll investigate further.
However, on a related note, I am using your latest VBCCR17.OCX version and it does not include WindowedLabel.
When I run the ComCtlsDemo and look in the form toolbox it is there.
Is there a reason it is not in VBCCR17.OCX or am I doing something wrong?
can the limit to the contents of the RichTextBox. be increased to more than 65536
You can send the "EM_EXLIMITTEXT" message to increase the characters limit:
Code:Private Const EM_EXLIMITTEXT As Long = &H435, lMaxLimit As Long = &H7FFFFFFF
SendMessage RichTextBox.hWnd, EM_EXLIMITTEXT, 0&, lMaxLimit
When I'm in this situation, and I've been there, I typically turn to the Scintilla OCX control. That thing will do just about anything you want to throw at it (within the limits of what a 32-bit program can do).
Also, it feels like we're spamming this codebank thread. I'm not sure why this isn't in the typical Q&A section.
Update released.
Included the Resize event in the FrameW control. (like the VB.Picture control)
A control container should have such event to re-arrange it's contained controls.
However, the VB.Frame control does not have it.
If I use SendMessageW(combo,CB_ADDSTRING,0,1) to add contents to a combo, when I click on the combo it only opens up with one item, as opposed to showing 10 items.
Any help appecirated
I got around it by doing the following :
Even though the Combo supports the .Redraw method, whilst doing tests, I still find using SendMessage a quicker way to add large amounts to combos.Code:For iSockets = 0 To 9999
If iSockets < 10 Then
cmbSockets.AddItem iSockets
cmbSockets.ItemData(cmbSockets.NewIndex) = iSockets
Else
lngAddIndex = SendMessageW(cmbSockets.hWnd, CB_ADDSTRING, 0, StrPtr(iSockets))
SendMessageW cmbSockets.hWnd, CB_SETITEMDATA, lngAddIndex, ByVal iSockets
End If
Next iSockets
cmbSockets.ListIndex = 0
Lee.
I am trying a test of the richtextbox control to see if I can paste in some chinese text.
I created a new project and put a reference to oleguids.tlb, that file located in the project folder but none of the new controls are there.
I also tried regserv32 that file in the syswow64 folder but it gave me error.
I am running windows 11 PRO
What do I need to do?
Whatever I am doing is not working
Update released.
Included the AutoVerbMenu in the RichTextBox control.
The MS RTB does localize it, so why not, for compatibility? The .NET version also allows the user to replace it with a custom one optionally calling the functions provided by the items of the default one. I did that 2 times already.
I guess the richtx32.ocx does not localize it .. or am I wrong ?
Code:2000 MENU
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
POPUP "Context"
{
MENUITEM "&Undo\tCtrl+Z", 2104
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", 2100
MENUITEM "&Copy\tCtrl+C", 2101
MENUITEM "&Paste\tCtrl+V", 2102
MENUITEM "&Delete\tDel", 2103
MENUITEM SEPARATOR
MENUITEM "&Object", 2110
}
}
Hi, after you reference it then what do you do?
I do see it in the references and have it checked.
I do not see any new controls showing in the toolbox on the left.
I see in your example user controls showing up on the right in the IDE.
Must be something left for me to do to use them
I am used to toolbox controls.
Thanks for any help.
in an inspiration moment I found this
https://www.vbforums.com/showthread....mmon-controls)
downloaded. put it in the vb6 IDE, then compiled as an OCX control.
Is this what gets referenced in the vb6 ide?
I get a name conflicts error
How to get beyond that?
someone said they had something twice in their vbp file, so here is mine, dont see anythng twice
Code:Type=Exe
Reference=*\G{00000300-0000-0010-8000-00AA006D2EA4}#2.5#0#..\Program Files (x86)\Common Files\System\ado\msador15.dll#Microsoft ActiveX Data Objects Recordset 2.5 Library
Object={EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0; ieframe.dll
Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#..\Windows\SysWOW64\scrrun.dll#Microsoft Scripting Runtime
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\Windows\SysWOW64\stdole2.tlb#OLE Automation
Reference=*\G{7C0FFAB0-CD84-11D0-949A-00A0C91110ED}#1.0#0#..\Windows\SysWOW64\msdatsrc.tlb#Microsoft Data Source Interfaces
Reference=*\G{56BF9020-7A2F-11D0-9482-00A0C91110ED}#1.0#0#..\WINDOWS\SysWow64\MSBind.dll#Microsoft Data Binding Collection
Reference=*\G{8620B873-D801-11D2-AC47-00600832A1F6}#2.1#0#..\WINDOWS\SysWow64\VBPrnDlg.dll#Microsoft VB Printer Dialog(PSS)
Reference=*\G{2A75196C-D9EB-4129-B803-931327F72D5C}#2.8#0#..\Program Files (x86)\Common Files\System\ado\msado28.tlb#Microsoft ActiveX Data Objects 2.8 Library
Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0; mscomctl.OCX
Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; richtx32.Ocx
Object={648A5603-2C6E-101B-82B6-000000000014}#1.1#0; MSComm32.Ocx
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; ComDlg32.OCX
Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TabCtl32.Ocx
Form=frmSearch.frm
Form=frmLogon.frm
Form=frmMaintain.frm
Form=frmData.frm
Form=frmMarcIn.frm
Form=frmMarcOut.frm
Form=frmPatron.frm
Form=frmPatronDelete.frm
Form=frmPatronSearch.frm
Form=frmCheckout.frm
Form=frmOverDue.frm
Form=frmAbout.frm
Form=frmMarcSearch.frm
Class=clsElasticForms; clsElasticForms.cls
Module=Module2; Choosecolor.bas
Form=frmMarcChoices.frm
Form=MDIMarc.frm
Form=frmFind.frm
Form=frmMarcBrkr.frm
Form=frmHelpBrkr.frm
Module=Module1; LogonPrivelege.bas
Form=frmDisplay.frm
Form=frmChoicesHelp.frm
Form=frmadder.frm
Form=frmRepair.frm
Module=Module5; Slidder1.bas
Module=Module3; MarcUpdate.bas
Module=Module6; PublicFunction.bas
Form=frmCirc.frm
Module=Module7; CircRecorder.bas
Module=Module8; MarcBrkr.bas
Module=Module9; SQLCreatedatabase.bas
Module=Module11; MSDEcreateDatabase.bas
Form=frmOpener.frm
Form=frmSortSdls.frm
Form=frmMarcExporter.frm
Form=frmMarcTagExport.frm
Form=frmMSDEConnect.frm
Form=frmPrintSpline.frm
Form=frmPrintBarcodes.frm
Form=frmPrintRecord.frm
Class=RegAccess; Regacces.cls
Form=frmMSDEmaster.frm
Form=frmGlobalsettings.frm
Form=frmPatronLimit.frm
Form=frmPrintPRecord.frm
Form=frmPrintPBarcode.frm
Form=frmPrintPLabels.frm
Form=frmFailure.frm
Form=frmStoredQuery.frm
Form=frmINternet.frm
Class=clsFormResizer; clsFormResizer.cls
Form=frmDewey2.frm
Form=frmFindRecord.frm
Form=frmCheckAdjust.frm
Form=frmDatabaseSelect.frm
Form=frmSearchfirst.frm
Form=frmLOCsearch2.frm
Module=Module10; Util.bas
Form=frmNag.frm
Form=frmList.frm
Form=frmRepairMysql.frm
Form=frmDisplayMessage.frm
Form=frmTagSort.frm
Form=frmInsert008.frm
Form=frmInsert007.frm
Form=frmAlterMysql.frm
Class=UndoElement; UndoElement.cls
Module=MyHyperlink; MyHyperlink.bas
Module=Module4; Module4.bas
Form=frmLists.frm
Form=frmListsInput.frm
Module=Module12; marcwriter2.bas
Form=frmCHistory.frm
Module=Module13; showfont.bas
Form=frmWaitNotice.frm
Form=frmDisplayMessage2.frm
Form=frmDelete.frm
Module=PublicVars; PublicVars.bas
IconForm="frmData"
Startup="frmLogon"
HelpFile=""
Title="BookStore"
ExeName32="BookStore.exe"
Command32=""
Name="BookStore"
HelpContextID="0"
CompatibleMode="0"
MajorVer=2
MinorVer=3
RevisionVer=1
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Hampton Christian Schools"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
DebugStartupOption=0
[MS Transaction Server]
AutoRefresh=1
[RVB]
DeleteClass1=Module13
DeleteClass2=Module13
DeleteClass3=frmTranslate
DeleteClass4=frmStoredQuery2
DeleteClass5=frmStoredQuery2
DeleteClass6=Module10
Well could it be the MS common control reference must first be removed to add in this new one?
I don't actually know what I am talking about here, as I don't see that kind of reference in the list.
I think doing that all the forms current controls will be gone.
Do you have to redesign all the forms again with the new controls?
Or is there another way to do this?
I can try it on a program backup to see what happens. I have a lot forms and a lot of controls on them.
Too bad MS cared nothing about Unicode at the time they created vb6 controls, that was a serious flaw in vb6.
EDIT here
I may be on to something.
I removed reference to OLE Automation, vb6 IDE let me remove it.
Then program would not run, so it needs that. Left it out.
Then I went to components and added the new unicode controls OCX, vb6 IDE accepted them.
Then went back to references, added OLE Automation back in
It took it in the vb6 IDE. And the new controls appear on the left side tool box list.
Program runs
?? Anyone know why it does this?
I found out OLE Automation had to be not in the references by creating a new EXE project.
Without it, I was able to add the unicode components.
So am I doing it correctly now?
These Unicode aware controls as Great!
Setup a little test using right click paste and sendmessage to paste into box chinese text, it works good
Example is very simple here, 2 rtb, one is MS, one is Krool's.
All i did was after compiling the OCX referenced it using components manage in the vb6 IDE
chinese text keyboard is here https://www.branah.com/chinese
also seeing if I can send a sample code of the project here
I found an issue when mixing the Krool RTB control and the MS RTB control on the same form.
Has to do with a function to enable URL detection which I have used for decades. it lights up a url in blue showing it as a hyperlink.
It seems to work ok if all the RTB are MS or all the RTB are Krool
But here I have 2 krool RTB, then 1 MS RTB, and the function dies and complains about type mismatch 13
I have 2 versions of functions to detect url and both do the same failure. And then nothing you can do except delete the failing RTB control, it will never work again.
for this example, the first 2 lines execute fine, hits number 3 and it dies with the error.
MyDetectURL rtxtMarckrool1, True, rtxtMarckrool1
MyDetectURL rtxtMarckrool2, True, rtxtMarckrool2
MyDetectURL RichTextBoxMS, True, RichTextBoxMS
EnableAutoURLDetection RichTextBoxMS
If you can look into it, just run it, dont run with full compile as it is incomplete.
I was messing with deleting RTB and putting new one on same form with different names but I see no discernable failure pattern.
Something happens with the RTB control, either MS or Krool when mixed together on a form and the
MyDetectURL and EnableAutoURLDetection function hates it.
Well, one way around this, dont use that external enable URLdetection function as Krool's box has already URL autodetect enabled, if in the property pages you enable that. MyUrlAutodetect will turn that on in the box regardless of the setting.
Tested and working.
And it must somehow be similar as it still has the bug of autodetecting a fake URL
You can witness that by typing in the rtb, \\anytextyoulike and it lights up as a URL hyperlink.
It also does the same thing with MS rtb and the myurlautodetect function
What is real crappy though is I discovered this problem follows the whole project as in any form with a richtextbox will fail trying to use myurlautodetect. It just makes more work as you have to do all of them if you want to run program for testing. I have like 20 rtb scattered on many forms
So that really commits you.
That means all the RTB must be replaced on every form in the project, if you want URLs working.
I added a second form with an MS RTB and it dies with type mismatch 13
command button causes form2.show and the myurlautodetect is in the form load
and it dies
Is there another way to do a rtb.span ? With the new control?
That method is gone.
I do this to reset the font colors to black.
see on searches, I light up found search text with a blue color
That needs to go away back to black text in the RTB
Public Function InitializeRichText(RTB As RichTextBox, lcolor As Long) As Integer
'Initialize richtext box to black
'rtb.SelStart = 0
RTB.Span (RTB.Text)
'rtb.SelLength = Len(rtb.Text)
RTB.SelBold = False
RTB.SelColor = lcolor
End Function
for this form I solved by removing the function and just doing the process in the paintform sub directly.
This control does not like being referenced like RTB as Richtextbox in a public function?
Since I reset a bunch of rtb back to black after searches found, it will add more lines of programming unless someone knows how to use this in a function like the below line shows.
**********************************************************************************
'RichTextBlack
'Public Function InitializeRichText(RTB As RichTextBox, lcolor As Long) As Integer
'Initialize richtext box to black
**********************************************************************************
this here worked
rtxtMarc.SelStart = 0
rtxtMarc.SelLength = Len(rtxtMarc.Text)
rtxtMarc.SelBold = False
rtxtMarc.SelColor = vbBlack