Checkbox with multiline label

  1. 5 days ago

    Beatrix W

    Nov 6 Pre-Release Testers, Third Party Store Europe (Germany)

    I'm adding spanish localisation to my app. One checkbox has a label that in spanish would be 2 lines of text. But when I make the checkbox higher the checkbox shows up in the middle and the label doesn't do multiline at all.

    Do I need to do my own multiline checkbox or is there a simpler way?

    @Beatrix W But the vertical alignment of the checkbox also isn't correct. I don't think I can control that.

    Well... the "Layout Preview" in the XojoIDE seems to vertically align the Checkbox and doesn't match the look&feel of the Runtime.
    In a built .app the Checkbox seems to be aligned with "Line 1" (at least on macOS).

  2. Jürg O

    Nov 6 Pre-Release Testers, Xojo Pro

    Have you tried to add the LineBreak explicitly?

    MyCheckbox.Caption = "Text Line 1" + EndOfLine + "Text Line 2"
  3. Beatrix W

    Nov 6 Pre-Release Testers, Third Party Store Europe (Germany)

    That might fix the text part of the checkbox. But the vertical alignment of the checkbox also isn't correct. I don't think I can control that.

  4. Rick A

    Nov 6 Pre-Release Testers (Brazil. GMT-3:00)
    Edited 5 days ago

    What about an empty caption and separated Label control with .Multiline = True ?

    -image-

  5. Beatrix W

    Nov 6 Pre-Release Testers, Third Party Store Europe (Germany)
    Edited 5 days ago

    If you click on the label of the checkbox then the state of the checkbox is changed, too. That would be the simple workaround.

  6. Rick A

    Nov 6 Pre-Release Testers (Brazil. GMT-3:00)

    @Beatrix W If you click on the label of the checkbox then the state of the checkbox is checked, too

    If you want this, add the extra switch to the label, like:

    Function MouseDown(X As Integer, Y As Integer) Handles MouseDown as Boolean
      CheckBox1.Value = Not CheckBox1.Value
    End Function

    And yes, a multiline ability to the check box caption, should be great.

  7. Jürg O

    Nov 6 Pre-Release Testers, Xojo Pro Answer

    @Beatrix W But the vertical alignment of the checkbox also isn't correct. I don't think I can control that.

    Well... the "Layout Preview" in the XojoIDE seems to vertically align the Checkbox and doesn't match the look&feel of the Runtime.
    In a built .app the Checkbox seems to be aligned with "Line 1" (at least on macOS).

  8. Markus R

    Nov 6 Pre-Release Testers, Xojo Pro Europe / Germany

    or check box + a label one row below.
    or using a Container Control to reuse this.

  9. Maximilian T

    Nov 6 Pre-Release Testers, Xojo Pro Europe, Germany, Berlin

    I think I read somewhere that the Apple Human Interface guidelines state that multiline labels for checkboxes are frowned upon, that's why the native checkbox doesn't support them. You need to roll your own.

  10. Beatrix W

    Nov 6 Pre-Release Testers, Third Party Store Europe (Germany)

    §$%& forum. Why is my post gone?

    Anyways. Thanks, guys, I'll go with the checkbox and label.

  11. Richard D

    Nov 6 Pre-Release Testers, Xojo Pro Europe (UK, London)

    @MaximilianTyrtania I think I read somewhere that the Apple Human Interface guidelines state that multiline labels for checkboxes are frowned upon, that's why the native checkbox doesn't support them. You need to roll your own.

    why is it frowned upon??

  12. Rick A

    Nov 6 Pre-Release Testers (Brazil. GMT-3:00)

    @Richard D why is it frowned upon??

    Couldn't find an "Apple reason" TM. https://developer.apple.com/design/human-interface-guidelines/macos/buttons/checkboxes/

or Sign Up to reply!