Checkbox with multiline label

  1. 7 months ago

    Beatrix W

    6 Nov 2019 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

    6 Nov 2019 Testers, Xojo Pro

    Have you tried to add the LineBreak explicitly?

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

    6 Nov 2019 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

    6 Nov 2019 Testers, Xojo Pro (Brazil. UTC-3:00)
    Edited 7 months ago

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

    -image-

  5. Beatrix W

    6 Nov 2019 Testers, Third Party Store Europe (Germany)
    Edited 7 months 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

    6 Nov 2019 Testers, Xojo Pro (Brazil. UTC-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

    6 Nov 2019 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

    6 Nov 2019 Testers, Xojo Pro Europe / Germany / Lower Saxon...

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

  9. Maximilian T

    6 Nov 2019 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

    6 Nov 2019 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

    6 Nov 2019 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

    6 Nov 2019 Testers, Xojo Pro (Brazil. UTC-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!