GraphicButton Image change with click

Started by pascal_dedi · 2013-12-05 11:11 UTC · 4 replies · SMF topic #2069

Hi , i am new in Forum,
how can i for a GraphicButton 2 Image use?

eg. for one click "Image a", second click "Image b", next click again "Image a", next click "Image b" so.

Thankyou


(defun c:Layer_Manager_Form1_GraphicButton5_OnClicked (/)

(if

????????????????

(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5  105)

(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5  104)
)
  )     
Maybe this?

(if (/= (dcl_Control_GetPicture Layer_Manager_Form1_GraphicButton5) 105) ...)

hi, thank you .
I have also solved, with extra button value :)


;(if
;(= but_val 0)
;(progn
;(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5  105)
;(setq but_val 1)
;)
;(progn
;(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5  104)
;(setq but_val 0)
;)
;);if
Hm, why don't you use the property value as Owen recommended?


(dcl_Control_SetPicture Layer_Manager_Form1_GraphicButton5
  (if (/= (dcl_Control_GetPicture Layer_Manager_Form1_GraphicButton5) 105)
    105
    106
  ); if
); dcl_Control_SetPicture


That decreases the number of variables.

Regards, Fred
Hi Fred,
i use Owen Version,
sure he has better written, I self have written before Owen,
only for Info :-)