demonstrates the use of idle event.
#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/message_box>
#include <xtd/forms/radio_button>
namespace enable_changed_event_example {
class form1 :
public form {
public:
form1() {
radio_button1.name("radio_button1");
radio_button1.size({100, 17});
radio_button1.text("button1");
radio_button1.enabled_changed +=
event_handler(*
this, &form1::radio_button1_enabled_changed);
radio_button2.location({0, 39});
radio_button2.name("radio_button2");
radio_button2.size({150, 17});
radio_button2.text("Disable button1");
radio_button2.checked_changed +=
event_handler(*
this, &form1::radio_button2_checked_changed);
client_size({292, 273});
controls().push_back_range({radio_button1, radio_button2});
name("Form1");
}
private:
void radio_button1_enabled_changed(
object& sender,
const event_args& e) {
message_box::show("This button has been disabled.");
}
void radio_button2_checked_changed(
object& sender,
const event_args& e) {
radio_button1.enabled(false);
}
};
}
auto main() -> int {
application::run(enable_changed_event_example::form1 {});
}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.h:32
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10