Re: UI design problem - exclusive checkboxes



I have a UI design problem.

I have four checkboxes, each one is one function and whenever one is
selected, the other checkboxes should be invalid (unchecked).
You may say radio boxes are the best choice, but I must allow all
checkboxes unchecked, that's to say, the user can leave all checkboxes
unchecked.

I had a similar situation and solved it this way..

Make a radio box using normal checkbox controls




Drop three TCheckbox controls onto a form. For this example, I've named
them



cbOpenorders

cbClosedorders

cbAllorders



Let's add an event to the cbOpenorders.Onclick property in the object
inspector.



Then, set the OnClick event of cbClosedorders and cbAllorders to this
cbOpenorders event. All three boxes will call the same event handler which
reduces the amount of code required.



procedure TFrmPreorderViewDialog.cbOpenOrdersClick(Sender: TObject);

begin

if TCheckbox(Sender).Checked then

begin

cbOpenorders.Checked := (TCheckbox(Sender) = cbOpenorders);

cbClosedorders.checked := (TCheckbox(Sender) = cbClosedorders);

cbAllorders.checked := (TCheckbox(Sender) = cbAllorders);

End;

end;





In this example, the user would have the limited ability to check one box,
or no boxes.




.



Relevant Pages

  • Re: Different data shown based on user input
    ... my advice changes with the info that there are over 200 checkboxes. ... I suggest you use combo boxes. ... Dim strStub As String ...
    (microsoft.public.access.queries)
  • Re: Different data shown based on user input
    ... A form that knows which check boxes have been checked can be created like ... --check only one check box and observe that the other checkboxes are ... The basic process is to build the query using the fields that have been ... Dim strStub as String ...
    (microsoft.public.access.queries)
  • Re: Checkbox cannot be used on 2003 document
    ... If the check boxes are from the legacy controls (which they will be if the ... can insert and remove checks from the checkboxes in that document. ... I could not find teh checkbox tool in teh 2007 native ...
    (microsoft.public.word.docmanagement)
  • Re: Multiple Checkboxes in Search by Form
    ... from checkboxes to a multi-select list box can I also make that change in my ... > build up the WhereCondition string to open a report, ... If none of the boxes are checked, ... > Dim strWhere As String ...
    (microsoft.public.access.queries)
  • Re: Allowing only 1 check box to be ticked
    ... check boxes, but I really don't think I get a choice in the matter. ... for each cbx in activecell.entirerow.checkboxes ... But you can cycle through all the checkboxes and look at the position of each ... I tried to edit your macro but didn't have any luck. ...
    (microsoft.public.excel.misc)