Page 94 of 101 FirstFirst ... 448491929394959697 ... LastLast
Results 3,721 to 3,760 of 4016

Thread: CommonControls (Replacement of the MS common controls)

  1. #3721

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    The old problem with DEMO-project. Krool didn't fixed it. The solution:

    https://www.vbforums.com/showthread....=1#post5632609
    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 ?

  2. #3722
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    Arrow Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    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 ?
    This is "MS Sans Serif". In my system it named "Microsoft Sans Serif".

    wikipedia/Microsoft_Sans_Serif


  3. #3723

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Nouyana View Post
    This is "MS Sans Serif". In my system it named "Microsoft Sans Serif".

    wikipedia/Microsoft_Sans_Serif

    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 ?

    Name:  Unbenannt.png
Views: 663
Size:  7.1 KB

    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.

  4. #3724
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    Arrow Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Yeah, but both are in the FontCombo... Can you re-check ?
    Not in my FontCombo. WinXP SP3 (edition 2021 from here).



    Quote Originally Posted by Krool View Post
    Both MS Sans Serif and Microsoft Sans Serif are valid and both should exist...
    Should, but not must. This is a clean WinXP SP2 with MS Office 2002:


  5. #3725
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    343

    Lightbulb Re: CommonControls (Replacement of the MS common controls)

    Yahoo!!! I've found it!

    Yes, this is not true-type font, so I've found it in a notepad...


  6. #3726

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    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.

  7. #3727
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    Re: CommonControls (Replacement of the MS common controls)

    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.

  8. #3728
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    466

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by MountainMan View Post
    Krool,

    I am using the ListView control. However, I want to change the width of a column...
    use ListView1.ColumnHeaders(1).Width to set the column width.

  9. #3729
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    Re: CommonControls (Replacement of the MS common controls)

    That works. Thanks!

  10. #3730
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    Re: CommonControls (Replacement of the MS common controls)

    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?

  11. #3731

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by MountainMan View Post
    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 don't understand.
    The LabelW is windowless, no hWnd property.
    What I added a while back was a new control called WindowedLabel.

  12. #3732
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    271

    Re: CommonControls (Replacement of the MS common controls)

    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?

  13. #3733

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by MountainMan View Post
    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?
    I accumulate a certain set of new features until I release VBCCR18.
    I can't update VBCCR17 as I did some breaking changes, RichTextBox and OLE props/events.

  14. #3734
    Lively Member
    Join Date
    Oct 2016
    Posts
    114

    Re: CommonControls (Replacement of the MS common controls)

    can the limit to the contents of the RichTextBox. be increased to more than 65536

  15. #3735
    PowerPoster VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,365

    Talking Re: CommonControls (Replacement of the MS common controls)

    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

  16. #3736
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    466

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    can the limit to the contents of the RichTextBox. be increased to more than 65536
    What limit? I tried the code below and get a text length of 70.000:

    Code:
    rtfLog.Text = String(70000, "a")
    Debug.Print rtfLog.textLength

  17. #3737
    Lively Member
    Join Date
    Oct 2016
    Posts
    114

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Mith View Post
    What limit? I tried the code below and get a text length of 70.000:

    Code:
    rtfLog.Text = String(70000, "a")
    Debug.Print rtfLog.textLength
    this is true, but when I type I am limited to 65536, and when I paste only the first 65536 characters are pasted.

  18. #3738
    Lively Member
    Join Date
    Oct 2016
    Posts
    114

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by VanGoghGaming View Post
    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
    thank you
    This gives me 1697420, I need more, much more

  19. #3739
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,799

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    can the limit to the contents of the RichTextBox. be increased to more than 65536
    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.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  20. #3740

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    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.

  21. #3741
    Junior Member
    Join Date
    Feb 2022
    Posts
    21

    Re: CommonControls (Replacement of the MS common controls)

    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

  22. #3742
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    466

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by logley View Post
    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
    combo.hWndList ?

  23. #3743
    Junior Member
    Join Date
    Feb 2022
    Posts
    21

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Mith View Post
    combo.hWndList ?
    I got around it by doing the following :

    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
    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.

    Lee.

  24. #3744
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    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 ?
    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
    Attached Images Attached Images   

  25. #3745

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by sdowney1 View Post
    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
    You don't need to register it via regsvr32.
    Just reference it in vb6 via references -> browse file.

  26. #3746

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Included the AutoVerbMenu in the RichTextBox control.
    Last edited by Krool; Apr 18th, 2024 at 11:20 AM.

  27. #3747

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.

    Included the AutoVerbMenu in the RichTextBox control.
    Should we have this menu localized ? (Via GetUserDefaultUILanguage)
    Last edited by Krool; Apr 18th, 2024 at 11:20 AM.

  28. #3748
    Lively Member
    Join Date
    Sep 2022
    Location
    Uruguay
    Posts
    69

    Re: CommonControls (Replacement of the MS common controls)

    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.

  29. #3749

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by jpfa View Post
    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
      }
    }

  30. #3750
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    You don't need to register it via regsvr32.
    Just reference it in vb6 via references -> browse file.
    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?
    Last edited by sdowney1; Apr 17th, 2024 at 02:11 PM.

  31. #3751
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    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
    Attached Images Attached Images  
    Last edited by sdowney1; Apr 17th, 2024 at 02:33 PM.

  32. #3752
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    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?
    Last edited by sdowney1; Apr 17th, 2024 at 04:08 PM.

  33. #3753
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    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
    Attached Images Attached Images  
    Attached Files Attached Files

  34. #3754
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    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.
    Attached Images Attached Images   
    Attached Files Attached Files

  35. #3755
    PowerPoster VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,365

    Wink Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by sdowney1 View Post
    Something happens with the RTB control, either MS or Krool when mixed together on a form and the
    MyDetectURL and EnableAutoURLDetection function hates it.
    Krool RTB is sentient and when it detects MS RTB it wants to assimilate it, resistance is futile...

  36. #3756
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by VanGoghGaming View Post
    Krool RTB is sentient and when it detects MS RTB it wants to assimilate it, resistance is futile...
    Yeah, I don't doubt it a bit.

  37. #3757
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    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

  38. #3758
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    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
    Attached Images Attached Images   

  39. #3759

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,567

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by sdowney1 View Post
    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
    If you have 2 references you can't declare "As RichTextBox" w/o putting the lib before, e.g. "As VBCCR17.RichTextBox".
    If you want both in 1 sub then resort to "As Object".

  40. #3760
    Fanatic Member
    Join Date
    Mar 2024
    Posts
    874

    Re: CommonControls (Replacement of the MS common controls)

    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
    Last edited by sdowney1; Apr 18th, 2024 at 06:17 AM.

Page 94 of 101 FirstFirst ... 448491929394959697 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width