Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ej02_BotonesYEventosForma
- Ejemplo para crear una forma, agregarle un boton y
- ver alguno de los eventos que puede tener dicha forma */
- #include <radc++.h>
- //create new form
- Form Form1("Evento Boton - RAD C++ Ejemplo");
- //create new button
- Button Button1("Soy un boton", AUTO_ID, 10, 15, 100, 150, Form1);
- //create new control procedure for form, procedure1 is procedure name
- FormProcedure procedure1 (FormProcArgs) {
- //capture event ON_CLOSE which is fired when form is closed, [X] is clicked
- ON_CLOSE() {
- //exit application
- Application.close();
- }
- //capture button click, means Button has been clicked
- ON_COMMAND_BY ( Button1 ) {
- Form1.msgBox("Hola Universo!");
- }
- //always return 0
- return 0;
- }
- //rad c++ main program
- rad_main()
- //attach the created procedure with form
- Form1.procedure = procedure1;
- rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement