Advertisement
idsystems

CPP_RAD_Ejercicio38

Jun 21st, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. /* ej38_FormIcon
  2. Ejemplo para cambiar el icono asociado a la forma */
  3. #include <radc++.h>
  4.  
  5. Form   Form1("Cambiar/Poner el Icono de la Forma - RAD C++ Ejemplo");
  6. Button button1("Click a mi para cambiar el icono de la forma", AUTO_ID, 50, 10, 300, 35,  Form1);
  7.  
  8. //create some icon objects
  9. //NOTE:  IDI_HAND and IDI_EXCLAMATION are predefined by system
  10. Icon icon1(IDI_EXCLAMATION);
  11. Icon icon2(IDI_HAND);
  12.  
  13.  
  14. FormProcedure procedure1 (FormProcArgs) {
  15.         ON_CLOSE() Application.close();
  16.        
  17.         ON_COMMAND_BY(button1) {
  18.             //set new icon to form's title bar
  19.             Form1.icon = icon2;
  20.         }
  21.        
  22.         return 0;      
  23. }
  24.  
  25. rad_main()
  26.  
  27.         Form1.procedure = procedure1;
  28.        
  29.         //set default icon to form's title bar
  30.         Form1.icon = icon1;
  31.        
  32.         //center the button on form
  33.         button1.center();
  34.  
  35. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement