How do you group views?

Harris

Expert
Licensed User
Longtime User
I searched for "group views" but did not find anything.

Example:

4 check boxes (toggle buttons or radio buttons).

Checking 1 unchecks all others. I have a work around but I don't think it is very elegant. I am used to a group box in other develpoment systems.

Thanks
 

Harris

Expert
Licensed User
Longtime User
Excellent. I was using checkboxes on a panel - I shall give that a try. Like in other environments, do you have to set the tag to all like values (such as 1 for all) in order to group?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Like in other environments, do you have to set the tag to all like values (such as 1 for all) in order to group?
No, there is no Group parameter like in VB.
If you need different groups you must use as many Panels as groups, one Panel for each group.
The Tag parameter is just a text parameter not used by the OS.
But you can use the same routine for the RadioButton management and use the Tag parameter to know wich one has raised the event.

Best regards.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
The Tag parameter is just a text parameter not used by the OS.
To be pedantic the type of Tag is Object so you could actually store anything you wanted, such as a Map or a user-defined Type. This might be useful on occasion to store a set of data associated with a particular View.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
This might be useful on occasion to store a set of data associated with a particular View.[/QUOTE said:
I see this being used in the table example where the row, col are stored in the tag.

SInce a user may never select a radio button (and raise event), I use the following code to determine which item is checked when I return my custom panel. Is there a better way to handle this?

If RdoOff.Checked Then
RbTag = 1
End If
If RdoXYZ.Checked Then
RbTag = 2
End If
If RdoDEF.Checked Then
RbTag = 3
End If
If RdoOn.Checked Then
RbTag = 4
End If

Thanks
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Normally when using RadioButtons there is one checked by default that you know so setting RbTag to this one you already know it even if the user doesn't select another one.
And using one routine for the CheckedChange event you get the new one.

Best regards.
 
Upvote 0
Top