Please help, Option button to control Image box

Started by twong, August 23, 2012, 08:20:29 PM

Previous topic - Next topic

twong

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

vladgothe

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.

twong

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.

vladgothe

Put your pictures in an AutoCAD or BricsCAD Support Path and try to load them in your pictureboxes by using LoadPictureFile method.

Fred Tomke

Hi, maybe a dcl_picture_refresh could help.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]