tony.huerlimann 0 Posted September 4, 2023 The ordinary TCheckBox has just two states: checked and not checked. I need a checkbox with three states: checked, "half-checked" , not checked. (Or with multiple states). Exists there such a component in VCL or FNC? (I have an application where the user should choose between three states: "yes it's ok", "no, it's not", "not sure". What other component could be used?) Thanks Tony Share this post Link to post
Tom F 83 Posted September 4, 2023 (edited) A TCheckBox with AllowGrayed set to true has three possible states; checked, unchecked, and grayed according to : http://www.delphigroups.info/2/6/245597.html I thought TRzCheckbox might have more, but the thread seems to think not... Edit: here's the VCL documentation on it: https://docwiki.embarcadero.com/Libraries/Sydney/en/Vcl.StdCtrls.TCustomCheckBox.AllowGrayed Edited September 4, 2023 by Tom F 2 Share this post Link to post
aehimself 396 Posted September 6, 2023 (edited) I advise against the use of TCheckBox or similar for such an input. There are multiple reasons: "greyed" state doesn't clearly mean "not sure" AND you might have to click twice to change your answer from one answer to the other. I'd suggest to have three radio buttons, right next to each other, with each column having a title; like an online questionare. Somthing like this: Edited September 6, 2023 by aehimself 4 Share this post Link to post
Remy Lebeau 1397 Posted September 6, 2023 If UI space is an issue, you could use a TComboBox with Style=csDropDownList instead, and just have 3 items to choose from. Share this post Link to post
aehimself 396 Posted September 6, 2023 A ComboBox suffers from the same 2-click issue and while it does save space, still not the usual way to handle these inputs. If UI space is an issue you should be looking at how to increase the space, not on workarounds. Unfortunately at work people were doing something similar and just pulled things closer together when they ran out of UI space (or the infamous pagecontrols on tabsheets). The end result physically hurts to look at. Share this post Link to post
aehimself 396 Posted September 6, 2023 (edited) I found the meme about it: Edited September 6, 2023 by aehimself 1 1 Share this post Link to post
Tom F 83 Posted September 6, 2023 The DelphiGroups post I linked to previously mentions That Raize allows customizable glyphs. So, if the grayed out box as a third state is too ambiguous for you, you might check out is TCheckbox to see if you can modify the appearance of his checkboxes in a way that works for you. I was thinking of something like the one below, although I imagine that there are legitimate objections to the ambiguity as well as how difficult it might be to differentiate such a small difference in appearance between the second and third one. Share this post Link to post
Remy Lebeau 1397 Posted September 6, 2023 (edited) 3 hours ago, aehimself said: A ComboBox suffers from the same 2-click issue What, 1 click to open the list, and 1 click to select? I really don't think that is much of an issue. But if it is, then just use TRadioGroup/3xTRadioButton instead. Edited September 6, 2023 by Remy Lebeau Share this post Link to post
David Heffernan 2345 Posted September 7, 2023 On 9/4/2023 at 6:09 PM, tony.huerlimann said: I have an application where the user should choose between three states: "yes it's ok", "no, it's not", "not sure". What other component could be used? Radio group: - Yes it's OK - No it's not - Not sure Share this post Link to post
Fr0sT.Brutal 900 Posted September 7, 2023 13 hours ago, aehimself said: I found the meme about it: Well, business software and user software are two different things. I'd prefer many controls on a single form instead of tens of tabs with 2-3 controls on each (if you have to loop through all of them anyway). Just like a launchpad of an airplane. I doubt pilots would want to change all these buttons to a single touch screen. 1 Share this post Link to post
Die Holländer 45 Posted September 7, 2023 3 hours ago, Fr0sT.Brutal said: Well, business software and user software are two different things. I'd prefer many controls on a single form instead of tens of tabs with 2-3 controls on each (if you have to loop through all of them anyway). Just like a launchpad of an airplane. I doubt pilots would want to change all these buttons to a single touch screen. Its also a bit silly to compare a full user-info input screen with a single drop-down or touch button.. 🤪 1 Share this post Link to post
Uwe Raabe 2057 Posted September 7, 2023 Come on - it's a meme - it has to be silly. 2 Share this post Link to post
Die Holländer 45 Posted September 7, 2023 2 hours ago, Uwe Raabe said: Come on - it's a meme - it has to be silly. Share this post Link to post