No.
---
Btw(!), just noticed that DrawState API in the StatusBar crashes when the StrPtr() of the Text property is 0. I guess that's due to a recent MS update..
Will make a fix for that soon.
EDIT: Bugfix done.
Printable View
Here:
Attachment 185631
Yes the MSCOMCTL.OCX behavior is the same for the ToolBar.
So, yes. I keep everything like it is. Adding a "DisabledImage", "HotImage" property in a Button object would complicate everything and might be confusion due to the back-compat thing of the "fallback" to "Image" property.
2 RICHTEXTBOX PROBLEMS
1)
VBCCR17 OCX and EXE:
Make a new project and place a RichTextBox1 on the form.
RightToLeftMode = 0
RightToLeft = True
Run.
In here the whole RichTextBox1 renders black.
2)
I use an older version of the VBCCR RichTextBox.
The black background issue is not in it.
Question:
What should I do to add some spaces to the text?
When I put them after the \cf4, they do not appear.
Surprisingly the spaces are found before the text 'Boing'.
Other characters like . do work and appear at the end.
For now I begin with the spaces - they appear at the end (m1 in the example).
Not a good 'fix'.
Code:Dim m As String
Dim m1 As String
Dim m2 As String
Dim SomeSpaces As String
SomeSpaces = " " '5 spaces
'spaces are after the text
m1 = "{\rtf1 " & _
"{\colortbl ;\red227\green38\blue33;\red0\green128\blue0;\red51\green51\blue204;\red0\green0\blue0;}" & _
"\cf1" & _
SomeSpaces & _
"Boing \cf2Bum \cf3Tschak\cf4 "
'spaces are before the text
m2 = "{\rtf1 " & _
"{\colortbl ;\red227\green38\blue33;\red0\green128\blue0;\red51\green51\blue204;\red0\green0\blue0;}" & _
"\cf1Boing \cf2Bum \cf3Tschak \cf4 " & _
SomeSpaces
m = m1 'or m2
RichTextBox1.TextRTF = m
I can't compare with Richtx32.ocx, it doesn't have RTL.
Just a head's up. The demo for this project still doesn't run (as I reported in 2017). The .tbl files are included in a sub folder but they aren't registered so the reference to them fails and the demo dies at that point. If there was a readme included that explained how to register a TBL file, it could go a long way towards fixing this. Sadly, if the demo doesn't run, most people will quickly bail. Which is a real shame. This is an incredible project and it deserves to be seen and shared and used. But as I say... with a non-functional demo, it will be only used by a handful of people who can get it working.
That said, you can download the compiled OCX from a different thread. Most people should know how to register an OCX even without a readme and it works fine. Thanks for sharing this project and all the hard work that has gone into it.
I have no problem getting the demo project to run.
TLB files (assuming that's what you mean) get registered when you add them or open a project referencing them. You might run into trouble if you have a previous version registered and the path no longer exists. In that case the new version wouldn't register. You'd have to use the old path for the tlb, or recreate it (new version is fine), unregister, then delete it and open with the new path.
Tried in the EXE project and OCX.
Blackness bug is gone.
Simplified example:Quote:
The other question with the \cf4 I don't get..
Set a RichTextBox to RTL.
See the right aligned words in the RichTextBox.Code:RichTextBox1.TextRTF = "{\rtf1Boing Bum Tschak" & " "
The spaces should come after Tschak.
But the spaces are before Boing.
You can see this easily when you CTRL+A the RichTextBox content.
Now try
The spaces are after Tschak.Code:RichTextBox1.TextRTF = "{\rtf1" & " " & "Boing Bum Tschak"
Attachment 185711
---
What are the spaces for?
I want a label with right aligned colored text, RichTextBox should do it.
At the right I want a little offset from the edge.
A single space char would be enough.
Glad it works for you. It definitely doesn't work for me. I'm using a brand new laptop and it has no tlb files (that I know of) so I don't think it's an old version issue. If anything, it's probably the opposite - it may be that you had an old version installed which allowed you to get the demo to work.
I don't think most people work with tlb files or would even know what they were or how to register one or delete one. I know I don't and I've been using VB since VB 1.0 for DOS was released.
It's a shame this information isn't included with the demo. That was the point of my post.
You don't need to register them yourself, if you tried, that's probably where the problem arose.
Krool has updated the tlb in compatibility-breaking ways several times without changing the GUID (as have I with oleexp, so not complaining), so when I've upgraded, I've had to do some manual un registration to use the new version. But I also just built a new system this year so everything was new again; it ran fine.
TLBs (most of them, like OLEGuids and oleexp) are 100x easier to deal with registration wise than ocx, those are a consistent nightmare.
hi krool
I'm using your textboxes to display data in Arabic from database and they are doing very well.
However when adding data at runtime :
eg TextBoxW1.Text = "اللغة العربية" they are showing strange characters.
as opposed to VB textboxes which are showing data correctly at runtime but strange symbols from database.
eg Text1.Text = "اللغة العربية"
thanks
Toolbar problem with .DisabledImagelist
When a button is set to enabled = false by code the button shows the correct image.
This does not work when the button is TbrButtonStyleCheck + .Value = TbrButtonValuePressed.
See attached sample to play with:
Attachment 185784
EDIT:
MSCOMTL's toolbar shows the same behavior as in VBCCR17.
On Enabled = false for a button, the button style has to be default.
Otherwise the image from the .DisabledImagelist is not used.
Before setting Enabled = false, style and value must be stored for Enabled = true.
I wrote a helper function that stores the style and state of a button before appling the image.
It uses the button Tag to store the values.
This kind of works ok, but the Tag property is lost for other uses.
Ok, I could use a companion list instead of the Tag.
Bad is that this list has to be refreshed on every ButtonClick.
---
The problem is solved so far, but it is a cumbersome approach.
My wish is that VBCCR17's toolbar button uses the .DisabledImageList independent from the state and style of the button.
Something to play with:
Attachment 185824
Hi Krool,
I'm new here. Here can I download the latest version of your CommonControls replacement?
Thank you
This is solved by a little workaround.
I decided to store the button data in the tag of the toolbar and not in the tag of the single button.
Works ok.
Things I don't like so much:
1) Setting a button Enabled/Disabled requires a method.
2) The button state has to be stored on every button click.
3) The toolbar tag is occupied.
If someone should have the same problem:
Attachment 185831
i would like to as a SubMenu to the ToolbarButonMenu, how can i get the hMenu(hWnd) for each item
Good point. The hMenu is created on demand and not persistent.
So, a solution could be that whenever the popup menu is created a new "InitButtonMenu" event is fired with a TbrButton object and a hMenu pointer. So the developer can adjust the hMenu before it get's displayed by the ToolBar.
What you think ?
Ok. But then there is a problem of the ButtonMenuClick. Currently it fires if wID is > 0 and passed that n-th wID to a ButtonMenu object.
We would need to cap that, so that ButtonMenuClick only fires if wID is not higher then the ButtonMenus.Count.
If the wID is not in that range and <> 0 then a new event shall be called, let's say "ButtonSubMenuClick" which just passes the wID and the developer is then responsible for mapping it. Of course the TbrButton class can be passed also for enrichement.
Your thoughts?
Any idea here Krool?Quote:
hi krool
I'm using your textboxes to display data in Arabic from database and they are doing very well.
However when adding data at runtime :
eg TextBoxW1.Text = "اللغة العربية" they are showing strange characters.
as opposed to VB textboxes which are showing data correctly at runtime but strange symbols from database.
eg Text1.Text = "اللغة العربية"
thanks
You can't apply unicode literals in the VB6 IDE. You need to use ChrW() for each character and append them together.
I suggest you could use it for VB.TextBox because maybe your machine is in DBCS mode, so the VB6 IDE is "looks like unicode aware", but only while you are in DBCS mode. And any shipment to a computer which is not in DBCS mode will fail later.
I think this would be a good start, although i haven't tested it yet, but i don't think that TrackPopupMenu could be used on an existing menu. i am going to test it and/or find another method to take advantage of this.
I would rather stay away from callbacks.
maybe somebody else here could give some idea...
be that as it may, it would help for those who want to use images in the menu.
Hello Krool!
Thank you for your great contribution and developed this control, which I have been using all the time. It's great!
Now there are two questions:
1. "DTPicker" control lacks "BackColor" and "ForeColor" attributes
2. The "BackColor" and "ForeColor" properties of the "MonthView" control do not work after being set (the background color and text color will not change)
Please help us to solve the above problems.
Thank you.
I see. Thank you very much
So bad that crashes on Win7 Ultimate SP1 i really wanted to see MSCC6 as Manifested
You probably saw it on the Discord but I'll add it here for tracking purposes...
Would be really nice to have an option for PictureAlignment when CommandButton style = graphical, so the image can appear to the left/right/bottom instead of just top. Setting the Alignment option has no impact.
On the toolbar Button the Style Placeholder is missing. So what I have been using until now is, to set the style as TbrButtonStyleSeparator and set the CustomWidth to the desired width.
Seems ok, But! when the toolbar Wrappable is true the button will not go immediately to the next row of the toolbar. Only after a button with the style is not TbrButtonStyleSeparator which is before the placeholder has also been moved to the next row
when checking the Button .Left and .Top properties it returns 0 on both, as a result any controls which are dependent on these coordinates move to position 0,0
This will also be if there are more then one placeholders in sequence; they will not move to next row of buttons until the wrap include the button before all the placeholder(s).
I hope I explained it enough...
to test it , create a toolbar with a few buttons, create a button TbrButtonStyleSeparator and set Customwidth to 2000, Autosize= false , create a few more buttons. set toolbar Wrappable =true
create a picturbox
in code
set Picturebox Container = toolbar
set the picturebox cords to the button cords
resize the form to the middle of the placeholder and repeat setting the picturebox cords to the button cords (use a form resize event to see it better)
I have tested it further.
if i put a TbrButtonStyleSeparator with Autosize=true before the placeholder then the .Left and .Top properties remain as old, but it will not move dow until all buttons with TbrButtonStyleSeparator in the sequence don't fit on the row
OLEGuids.tlb has implemented IStorage, Please do me a favor to add IStream interface so that I can get rid of 'Edanmo's OLE interfaces & fuctions V1.81' in a project and avoid conflicts.
The IStorage in oleguids is a stub, you can't use it.
But as noted oleexp.tlb has not modified it from olelib.tlb 1.81 so you can at least only have the two.Code:[
uuid(0000000B-0000-0000-C000-000000000046),
odl,
]
interface IStorage : IUnknown
{
// Not done, guid placeholder only
};
You're best bet it to just explicitly qualify them. Otherwise, the order the TLBs appear in the References dialog is the order they're resolved in if not qualified. Since VBCCR qualifies everything in it's code, it should be fine to just put it 2nd if you don't want to explicitly qualify everything yourself.
I would like to have a control to input a value with decimals, a numeric input for prices with specific accuracy (say 3 decimals). which from those control can do that, and how?
See the attached project
As you can see it is very simply, and you cand freely modify to add more property or events if you need.
You can put the total number of digits in the Precision property, and the decimal digits in Scal property , I want to call it Scale like in Oracle but is not posible.
All I try it works fine.
Thank you. I found another solution to include units, using Krool TextBoxW. I will post here in the CodeBank
Found an issue:
"Missing: OLE Guid and interface definitions"
I found the missing file in the demo folder. Not sure if that will help anybody else but for the demo to run, the reference needs to be changed.
Is it possible to bypass ListView limitation of item's max value length 259 characters?
Microsoft mscomctl.ocx doesn't have that limitation.
Code:With listView1.ListItems.Add(1, , "Col1")
.SubItems(1) = String$(1000, "=")
Debug.Print Len(.SubItems(1)) 'returns 259, mscomctl.ocx unlimited
End With