#include <xtd/forms/application>
#include <xtd/forms/check_box>
#include <xtd/forms/form>
#include <xtd/forms/horizontal_layout_panel>
#include <xtd/forms/label>
#include <xtd/forms/list_box>
#include <xtd/forms/tab_control>
#include <xtd/forms/tab_page>
#include <xtd/forms/text_box>
#include <xtd/forms/toggle_button>
#include <xtd/startup>
class form1 :
public form {
public:
static auto main() {
}
form1() {
client_size({600, 450});
minimum_client_size(client_size());
text(
"Change parent control example");
top_panel.parent(*this);
top_panel.controls().push_back_range({left_panel, right_panel});
label1.parent(left_panel);
label1.text("Label text");
label1.location({10, 12});
label1.auto_size(true);
text_box1.parent(left_panel);
text_box1.text("Test box 1");
text_box1.location({100, 10});
text_box1.width(170);
list_box1.parent(left_panel);
list_box1.location({10, 50});
list_box1.size({260, 100});
list_box1.items().push_back_range({"Apple", "Orange", "Banana", "Strawberry"});
list_box1.selected_index(0);
toggle_button1.parent(left_panel);
toggle_button1.text("Toggle 1");
toggle_button1.location({10, 160});
tab_control1.parent(left_panel);
tab_control1.location({10, 210});
tab_control1.size({260, 160});
tab_page1.parent(tab_control1);
tab_page1.text("Page 1");
tab_page2.parent(tab_control1);
tab_page2.text("Page 2");
tab_page3.parent(tab_control1);
tab_page3.text("Page 3");
check_box1.parent(tab_page1);
check_box1.text("Check box 1");
check_box1.location({10, 10});
bottom_panel.parent(*this);
bottom_panel.height(50);
bottom_panel.controls().push_back_range({left_button, right_button});
left_button.text("Move controls to left panel");
left_button.enabled(false);
left_button.click += [&] {
left_button.enabled(false);
right_button.enabled(true);
label1.parent(left_panel);
list_box1.parent(left_panel);
toggle_button1.parent(left_panel);
text_box1.parent(left_panel);
tab_control1.parent(left_panel);
};
right_button.text("Move controls to right panel");
right_button.click += [&] {
left_button.enabled(true);
right_button.enabled(false);
label1.parent(right_panel);
list_box1.parent(right_panel);
toggle_button1.parent(right_panel);
text_box1.parent(right_panel);
tab_control1.parent(right_panel);
};
}
private:
list_box list_box1;
};
static const xtd::drawing::color dark_cyan
Gets a system-defined color that has an ARGB value of 0xFF008B8B. This field is constant.
Definition color.hpp:125
static const xtd::drawing::color yellow
Gets a system-defined color that has an ARGB value of 0xFFFFFF00. This field is constant.
Definition color.hpp:476
static const xtd::drawing::color navy
Gets a system-defined color that has an ARGB value of 0xFF000080. This field is constant.
Definition color.hpp:344
static const xtd::drawing::color black
Gets a system-defined color that has an ARGB value of 0xFF000000. This field is constant.
Definition color.hpp:80
Represents a single tab page in a tab_control.
Definition tab_page.hpp:33
Represents a standard Windows text box.
Definition text_box.hpp:31
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:167
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8