Page 87 of 87 FirstFirst ... 377784858687
Results 3,441 to 3,462 of 3462

Thread: CommonControls (Replacement of the MS common controls)

  1. #3441

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    2,044

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    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.

    EDIT: Bugfix done.
    Last edited by Krool; Aug 30th, 2022 at 11:45 AM.

  2. #3442
    Lively Member
    Join Date
    Oct 2016
    Posts
    86

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    Here's the DLL and PNG stuff.
    It is quite old and probably there are more elegant solutions.
    Also it is a adjusted to my needs.

    Attachment 180641

    I think #3089 is answered when you inspect the libs.
    in the Module m_PNG_Resource there is a call to a function Resize, (it is called from a procedure ResDLLToPicture ).

    i can not find this function in the code you attached could you be so kind and send it to me.

  3. #3443
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    509

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    in the Module m_PNG_Resource there is a call to a function Resize, (it is called from a procedure ResDLLToPicture ).

    i can not find this function in the code you attached could you be so kind and send it to me.
    Here:
    m_GDIPlusResize.zip

  4. #3444
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    509

    Re: CommonControls (Replacement of the MS common controls)

    from (Toolbar index problem)

    Quote Originally Posted by Krool View Post
    I understand.. However, the "solution" is not easy.
    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.
    Last edited by Karl77; Sep 1st, 2022 at 06:22 AM.

  5. #3445

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    2,044

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    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.

  6. #3446
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    509

    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.

  7. #3447
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    490

    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.

  8. #3448
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    3,460

    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.

  9. #3449

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    2,044

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    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.

    The other question with the \cf4 I don't get..

  10. #3450
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    509

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    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.

    The other question with the \cf4 I don't get..
    Simplified example:

    Set a RichTextBox to RTL.
    Code:
    RichTextBox1.TextRTF = "{\rtf1Boing Bum Tschak" & "     "
    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.

    Now try
    Code:
    RichTextBox1.TextRTF = "{\rtf1" & "     " & "Boing Bum Tschak"
    The spaces are after Tschak.

    Name:  2022-09-10_19-41-46.jpg
Views: 212
Size:  10.9 KB

    ---

    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.

  11. #3451
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    490

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by fafalone View Post
    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.

  12. #3452
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    3,460

    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.

  13. #3453
    Fanatic Member
    Join Date
    Oct 2013
    Posts
    766

    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

  14. #3454
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    509

    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.

    See attached sample to play with:
    2022-09-16_Toolbar.zip

    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:
    2022-09-21_Toolbar.zip
    Last edited by Karl77; Sep 21st, 2022 at 07:06 AM.

  15. #3455
    New Member
    Join Date
    Sep 2022
    Posts
    3

    Re: CommonControls (Replacement of the MS common controls)

    Hi Krool,

    I'm new here. Here can I download the latest version of your CommonControls replacement?

    Thank you

  16. #3456
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    509

    Re: CommonControls (Replacement of the MS common controls)


  17. #3457

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    2,044

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    My wish is that VBCCR17's toolbar button uses the .DisabledImageList independent from the state and style of the button.
    I understand your point(s). But I see no way to fix it..

  18. #3458
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    509

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    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.

    If someone should have the same problem:
    2022-09-22_Toolbar.zip
    Last edited by Karl77; Sep 22nd, 2022 at 07:00 AM.

  19. #3459
    Lively Member
    Join Date
    Oct 2016
    Posts
    86

    Re: CommonControls (Replacement of the MS common controls)

    i would like to as a SubMenu to the ToolbarButonMenu, how can i get the hMenu(hWnd) for each item
    Last edited by Semke; Sep 22nd, 2022 at 06:55 PM.

  20. #3460

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    2,044

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    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 ?

  21. #3461
    Lively Member
    Join Date
    Oct 2016
    Posts
    86

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    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; Today at 08:10 AM. Reason: typo

  22. #3462

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    2,044

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    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?

Page 87 of 87 FirstFirst ... 377784858687

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