Re: UI design problem - exclusive checkboxes
- From: "JohnE" <johne@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 May 2006 13:22:44 -0700
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.
.
- References:
- UI design problem - exclusive checkboxes
- From: Koms Bomb
- UI design problem - exclusive checkboxes
- Prev by Date: Re: Allen Bauer interview in Bitwise
- Next by Date: Re: Do BPL's Hurt Application Performance?
- Previous by thread: Re: UI design problem - exclusive checkboxes
- Next by thread: student
- Index(es):
Relevant Pages
|
|