DexoTronic Posted March 30, 2010 Share Posted March 30, 2010 Hi, i have 3 checkboxes, but i want to make it possible to select only 1 checkbox of the 3. these are the checkboxes: CbSteine = guiCreateCheckBox(9,166,120,35,"Steine 0.10$/KG",false,false,TruckAufladefenster) CbRohre = guiCreateCheckBox(9,196,120,35,"Rohre 0.15$/KG",false,false,TruckAufladefenster) CbWerkzeug = guiCreateCheckBox(9,227,138,35,"Werkzeug 0.20$/KG",false,false,TruckAufladefenster) now i tried this one(only for the first checkbox, as a test): function onClickBtn ( button, state ) if (button == "left" and state == "up") then if (source == CbSteine ) then if (guiCheckBoxGetSelected ( CbSteine ) == true) then CheckBoxSetSelected ( CbRohre, false ) CheckBoxSetSelected ( CbWerkzeug, false ) end end end end addEventHandler ( "onClientGUIClick", CbSteine , onClickBtn, false ) but it doesnt work anyone knows why? Link to comment
Dark Dragon Posted March 30, 2010 Share Posted March 30, 2010 you should use Radio Buttons for that, that's exactly what they are supposed to do (guiCreateRadioButton) use the same parent element for all 3 buttons, this way it will only be possible to select one of them at a time Link to comment
DexoTronic Posted March 30, 2010 Author Share Posted March 30, 2010 oki worked fine for me thank you Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now