Results 1 to 40 of 4199

Thread: CommonControls (Replacement of the MS common controls)

Hybrid View

  1. #1
    Fanatic Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    540

    Exclamation LabelW caption text is truncated under WinXP

    VBCCR v1.6.72 (Side-by-side)
    VB6sp6 (win7x64 developing machine)

    The caption text of some LabelW-Controls is truncated when using the app under WinXP (SP3).
    Many other Label-Controls at my app are not truncated.


    The form with the Label at the IDE at Win7:

    Name:  VB6 IDE Win7.png
Views: 5323
Size:  9.7 KB

    This is how the form looks using the app under WinXP:

    Name:  EXE WinXP.jpg
Views: 5495
Size:  21.8 KB
    Last edited by Shaggy Hiker; Mar 21st, 2020 at 10:16 AM.

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: LabelW caption text is truncated under WinXP

    Quote Originally Posted by Mith View Post
    VBCCR v1.6.72 (Side-by-side)
    VB6sp6 (win7x64 developing machine)

    The caption text of some LabelW-Controls is truncated when using the app under WinXP (SP3).
    Many other Label-Controls at my app are not truncated.
    Nobody can test, when you just attach an exe file (which is NOT allowed) and no source code (Project1.vbp)
    Please re-do.

    Quote Originally Posted by Mith View Post
    Does anyone have a clue why you can use 32-bit icons with Win7 and Win10 but the app crashes using WinXP, Vista and Win8!
    First i thought WinXP and Vista are too old but Win7 is older than Win8, i dont get it...

    for example:

    Windows XP supports 32-bit icons, which are 24-bit images with an 8-bit alpha channel.
    is it vb6 that not support 32bit icons on some OS version?
    or maybe you use a icon/image api that is not supported by some older OS?
    The problem is here OleAut32.lib and it's various OleLoadPicture API's. So it's MS fault, as so often. And it also doesn't matter if creating the IPicture by an byte stream or by an Path.

    What surprises me now is that Win8 also encounter the issue? (I can't test Win8)
    Can you try to to make the following quick and dirty test and try to load a 32-bit icon via VB's LoadPicture ?
    Code:
    Set Pic = LoadPicture("YourPath\test.ico")
    Your "run-time error 0" comes by following:
    You load and persist successfully the 32-bit icon in a "good" OS.
    The error comes then on an "bad" OS when you let VB creating the IPicture from the property bag. (design time usage in ImageList)
    When you would do it only at run-time you would receive the "invalid picture" error.

    I still don't know how to circumvent the issue, because since years the same question over and over re-appears.
    Last edited by Krool; Mar 21st, 2020 at 09:08 AM.

  3. #3
    Fanatic Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    540

    Re: LabelW caption text is truncated under WinXP

    VB example project for testing the LabelW caption text bug:
    Label-Test-WinXP-sourcecode.zip

    I've done a 32bit icon test with the following code under Win8.1 x64:

    Code:
    Dim pic As Variant
    Set pic = LoadPicture(App.Path & "\32bit.ico")
    Error message:

    Name:  Screenshot - 21.03.2020 , 21_44_33.png
Views: 1268
Size:  7.3 KB

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: LabelW caption text is truncated under WinXP

    Quote Originally Posted by Mith View Post
    VB example project for testing the LabelW caption text bug:
    Label-Test-WinXP-sourcecode.zip

    I've done a 32bit icon test with the following code under Win8.1 x64:

    Code:
    Dim pic As Variant
    Set pic = LoadPicture(App.Path & "\32bit.ico")
    Error message:

    Name:  Screenshot - 21.03.2020 , 21_44_33.png
Views: 1268
Size:  7.3 KB
    For me the LabelW I see no bug. It's behaving the same as VB.Label.
    Somehow your Win7 gives for the same font (Arial, Bold, 11pt) a width of 1500 twips and on your WinXP 1560. (Caption "Dateivergleich")
    For me it returns both 1560 on Win7 and WinXP.

    Anyhow, the safest approach is to make an "LabelW1.AutoSize = True" at run-time. (even if already True, re-applying with True will trigger a re-calculation)

    Concerning your icon test. How to avoid this dilemma? Maybe a warning sign when defining 32-bit color depth for an image list at design time. Because that would explain some users up front of an potential "run time error 0". (?)

  5. #5
    Fanatic Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    540

    Re: LabelW caption text is truncated under WinXP

    Quote Originally Posted by Krool View Post
    For me the LabelW I see no bug. It's behaving the same as VB.Label.
    Somehow your Win7 gives for the same font (Arial, Bold, 11pt) a width of 1500 twips and on your WinXP 1560. (Caption "Dateivergleich")
    For me it returns both 1560 on Win7 and WinXP.
    Are you sure you tested the compiled exe (SxS) or just the test project inside the IDE?

    I did another test with the compiled exe using a fresh installed WinXP 64bit and the caption text is here truncated too:

    Name:  Screenshot - 21.03.2020 , 23_22_18.png
Views: 1260
Size:  114.7 KB

    Concerning your icon test. How to avoid this dilemma? Maybe a warning sign when defining 32-bit color depth for an image list at design time. Because that would explain some users up front of an potential "run time error 0". (?)
    I had a lot of command buttons with 32-bit icons at the picture property.
    It was a pain in the ass to find all these controls with 32-bit icons...
    i guess a warning would be very nice to avoid such problems in the future.
    If someone develops a app that must also run with WinXP, Vista or Win8 he cannot use 32bit icons anywhere at the VBCCR controls.
    Im not sure how & where to implement such a warning if the dev adds somewhere a 32bit icon....

  6. #6
    Fanatic Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    540

    Re: LabelW caption text is truncated under WinXP

    Some news about the caption text bug:

    1. the labels use the font "Segoe UI" and this font is not installed under WinXP!
    2. i added some MS-Labels with the same text, font, font size and background color to the test project

    1&3. row is VBCCR and 2&4. row is MS:

    Name:  Screenshot - 21.03.2020 , 23_36_19.png
Views: 1393
Size:  102.0 KB

    As you can see the autosize works correct with the MS-Labels.
    Only the autosize of the background color is not correct.

    Maybe the font fallback causes the problem with the incorrect autosizing?

    New test project: Label-Test-WinXP-sourcecode.zip
    Last edited by Mith; Mar 21st, 2020 at 11:52 AM. Reason: added a new test project

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: LabelW caption text is truncated under WinXP

    Quote Originally Posted by Mith View Post
    Are you sure you tested the compiled exe (SxS) or just the test project inside the IDE?

    I did another test with the compiled exe using a fresh installed WinXP 64bit and the caption text is here truncated too:
    I don't test ever a compiled exe. Did you read my suggestion to put a LabelW.AutoSize = True at run-time, e.g. at Form_Load.

    The VB.Label behaves the same, means no automatic autosizing.
    The VB.Label and LabelW will for example also do autosizing when you change the .Caption property.

  8. #8
    Fanatic Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    540

    Re: LabelW caption text is truncated under WinXP

    Quote Originally Posted by Krool View Post
    I don't test ever a compiled exe.
    Why not? A compiled exe reacts different than a vb project inside the IDE!

    Did you read my suggestion to put a LabelW.AutoSize = True at run-time, e.g. at Form_Load.
    Yes, but is impractical for large projects...

    The VB.Label behaves the same, means no automatic autosizing.
    At my test with compiled exe the VB-Label does a correct autosizing of the the caption and the LabelW-control not!
    The VB-Label shows the complete text and the LabelW-Control truncates the text at the end...
    Look at the last screenshot again...

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