Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Karl77
Are there any functions I could use for the image processing in VBCCR?
Or another idea which is not a large additional library?
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Karl77
from (Toolbar index problem)
No solution needed.
I decided for a DisabledImagelist with the same count and order as the Imagelist.
---
I didn't compare the behavior to CC5; most probably the problem is the same.
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.
Re: CommonControls (Replacement of the MS common controls)
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.
Last edited by Karl77; Sep 10th, 2022 at 07:15 AM.
Re: CommonControls (Replacement of the MS common controls)
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.
Last edited by Darkbob; Sep 10th, 2022 at 08:43 AM.
Re: CommonControls (Replacement of the MS common controls)
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Karl77
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.
Update released. There was a tiny bug in the RightToLeft property which causes trouble if you set the two properties at design-time only..
That's now fixed. Please confirm.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
Update released. There was a tiny bug in the RightToLeft property which causes trouble if you set the two properties at design-time only..
That's now fixed. Please confirm.
Tried in the EXE project and OCX.
Blackness bug is gone.
See the right aligned words in the RichTextBox.
The spaces should come after Tschak.
But the spaces are before Boing.
You can see this easily when you CTRL+A the RichTextBox content.
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.
Last edited by Karl77; Sep 10th, 2022 at 12:47 PM.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by fafalone
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.
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.
Re: CommonControls (Replacement of the MS common controls)
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.
Re: CommonControls (Replacement of the MS common controls)
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
Last edited by samer22; Sep 30th, 2022 at 02:41 PM.
Re: CommonControls (Replacement of the MS common controls)
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.
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
I understand your point(s). But I see no way to fix it..
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Semke
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 ?
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
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 ?
I was thinking in that direction, this would also help adding picture to the menu, using ModifyMenu / MF_BITMAP
Last edited by Semke; Sep 29th, 2022 at 08:10 AM.
Reason: typo
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Semke
I was thinking I that direction, this would also help adding picture to the menu, using ModifyMenu / MF_BITMAP
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?
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
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?
i understand that you want to apply events for the submenu, i think this would be a never ending affair, one might add subsubmenues etc. i was thinking of just using ModifyMenu/MF_POPUP and programaticly use CreatePopupMenu, AppendMenu and TrackPopupMenu
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Semke
i understand that you want to apply events for the submenu, i think this would be a never ending affair, one might add subsubmenues etc. i was thinking of just using ModifyMenu/MF_POPUP and programaticly use CreatePopupMenu, AppendMenu and TrackPopupMenu
True.
New idea, having just a new "InitButtonMenu" with ByVal hMenu As Long and a ByRef Handled As Boolean.
If you change Handled to True the ToolBar control will not go further (TrackPopupMenu) and destroys just hMenu, since you decided it's all handled.
?
Re: CommonControls (Replacement of the MS common controls)
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
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by samer22
Any idea here Krool?
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
True.
New idea, having just a new "InitButtonMenu" with ByVal hMenu As Long and a ByRef Handled As Boolean.
If you change Handled to True the ToolBar control will not go further (TrackPopupMenu) and destroys just hMenu, since you decided it's all handled.
?
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.
Re: CommonControls (Replacement of the MS common controls)
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)
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by smileyoufu
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)
Re: CommonControls (Replacement of the MS common controls)
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.
Re: CommonControls (Replacement of the MS common controls)
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
Re: CommonControls (Replacement of the MS common controls)
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.
Re: CommonControls (Replacement of the MS common controls)
The IStorage in oleguids is a stub, you can't use it.
Code:
[
uuid(0000000B-0000-0000-C000-000000000046),
odl,
]
interface IStorage : IUnknown
{
// Not done, guid placeholder only
};
But as noted oleexp.tlb has not modified it from olelib.tlb 1.81 so you can at least only have the two.
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.
Re: CommonControls (Replacement of the MS common controls)
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?
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by georgekar
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.