(SOLVED)Problem with Checkbox..Can you help me please???

Just starting out? Need help? Post your questions and find answers here.
User avatar
LESTROSO
Enthusiast
Enthusiast
Posts: 124
Joined: Thu Nov 03, 2005 12:30 pm
Location: Italy
Contact:

(SOLVED)Problem with Checkbox..Can you help me please???

Post by LESTROSO »

I try to work with this code...but nothing works....i need to use it in a loop but i want to use only when the check box change the state....Can you help me please?? Lestroso :oops:

Code: Select all


Select event
    Case #PB_Event_CloseWindow
      ProcedureReturn #False

    Case #PB_Event_Menu
      Select EventMenu()
      EndSelect

    Case #PB_Event_Gadget
      Select EventGadget()

   Case CheckBox_0
                If EventType() = #PB_EventType_Change
                  Select GetGadgetState(CheckBox_0)                  
                    Case 1              
  MessageRequester("CheckBox 0 is ","turned  On...")

      EndSelect
        EndIf
  
Last edited by LESTROSO on Tue Jun 04, 2019 2:51 pm, edited 1 time in total.
User avatar
Mijikai
Addict
Addict
Posts: 1517
Joined: Sun Sep 11, 2016 2:17 pm

Re: Problem with Checkbox..Can you help me please???

Post by Mijikai »

What exactly do you want to do (i dont get it) :?:
infratec
Always Here
Always Here
Posts: 7577
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Problem with Checkbox..Can you help me please???

Post by infratec »

Why should I wrote code when you want to know something?

Please provide a working example next time.

Maybe you mean something like this:

Code: Select all

If OpenWindow(0, 0, 0, 270, 160, "CheckBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CheckBoxGadget(0, 10,  10, 250, 20, "CheckBox standard")
  CheckBoxGadget(1, 10,  40, 250, 20, "CheckBox checked"): SetGadgetState(1, #PB_Checkbox_Checked)
  CheckBoxGadget(2, 10,  70, 250, 20, "CheckBox three state", #PB_CheckBox_ThreeState): SetGadgetState(2, #PB_Checkbox_Inbetween)
  CheckBoxGadget(3, 10, 100, 250, 20, "CheckBox right", #PB_CheckBox_Right)
  CheckBoxGadget(4, 10, 130, 250, 20, "CheckBox center", #PB_CheckBox_Center)
  Repeat
    Event = WaitWindowEvent()
    
    Select Event
      Case #PB_Event_Gadget
        Select EventGadget()
          Case 0 To 4
            Debug "----"
            For i = 0 To 4
              Debug GetGadgetState(i)
            Next i
            
        EndSelect
    EndSelect
    
  Until Event = #PB_Event_CloseWindow
EndIf
A CheckboxGadget() don't fire a #PB_EventType_Change. You have to read the help.
User avatar
LESTROSO
Enthusiast
Enthusiast
Posts: 124
Joined: Thu Nov 03, 2005 12:30 pm
Location: Italy
Contact:

Re: (SOLVED)Problem with Checkbox..Can you help me please???

Post by LESTROSO »

DEAR INFRATEC!!!I thank you, thousands thanks!! You helped me so much!!! Thanks again....Bye Lestroso :D :D :D
Post Reply