OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: twong on August 23, 2012, 08:20:29 PM

Title: Please help, Option button to control Image box
Post by: twong on August 23, 2012, 08:20:29 PM
Hi all,
I have 4 Option buttons (not Option list). Button 1,2 is a group set and button 3,4 is another group set. If click 1 and 3 then show a image in Picture box, click 1,4 then show another one, Clicked Events is on in odcl but I just can't make it. Please anyone can see my code.

(command "OPENDCL")

(defun c:test ()
  (dcl_Project_Load "Test" T)
  (dcl_Form_Show test_Form1)
  (princ)
  )

(defun c:test_Form1_OptionButton1_OnClicked (/)
  (setq button1_value (dcl_Control_GetValue test_Form1_OptionButton1))
  (setq button3_value (dcl_Control_GetValue test_Form1_OptionButton3))
  (setq button4_value (dcl_Control_GetValue test_Form1_OptionButton4))
  (if (and (= button1_value 1)(= button3_value 1))
    (dcl_Control_SetPicture test_Form1_PictureBox1 101)
    )
  (if (and (= button1_value 1)(= button4_value 1))
    (dcl_Control_SetPicture test_Form1_PictureBox1 102)
    )
)

Thank you.

T
Title: Re: Please help, Option button to control Image box
Post by: vladgothe on August 24, 2012, 01:39:12 AM
Tell us what the problem is: the image is not shown in the picture box or you get another error message at runtime? In OpenDCL Studio, in Project menu edit the picture folder, remove all the images, add them again and then save the project. Maybe you didn't save the project when you added the pictures.
Title: Re: Please help, Option button to control Image box
Post by: twong on August 24, 2012, 02:42:57 AM
The problem is it didn't show up or change the picture when I click the Option button. I just tried what you said and still not work.
Title: Re: Please help, Option button to control Image box
Post by: vladgothe on August 24, 2012, 03:25:50 AM
Put your pictures in an AutoCAD or BricsCAD Support Path and try to load them in your pictureboxes by using LoadPictureFile method.
Title: Re: Please help, Option button to control Image box
Post by: Fred Tomke on August 24, 2012, 07:44:04 AM
Hi, maybe a dcl_picture_refresh could help.

Regards, Fred