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 ?
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
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".
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 ?
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.
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.
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.
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?
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by MountainMan
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by MountainMan
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Semke
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.
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.
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by logley
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by sdowney1
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.
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by jpfa
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 ?
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
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.
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.
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
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.
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by sdowney1
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...
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
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
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by sdowney1
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".
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