xtd 0.2.0
Loading...
Searching...
No Matches
form_background_image.cpp

demonstrates how to use of xtd::forms::form control with background_image.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/images>
#include <xtd/startup>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace form_background_image_example {
class form_main : public form {
public:
static auto main() {
application::run(form_main());
}
form_main() {
double_buffered(true);
background_image(images::from_name("xtd", drawing::size(64, 64)));
text("form with background image example");
button.parent(*this);
button.text("Close");
button.location({10, 10});
button.click += event_handler(*this, &form::close);
}
private:
};
}
startup_(form_background_image_example::form_main::main);
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31
Represents a Windows button control.
Definition button.hpp:49
virtual drawing::point location() const noexcept
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
event< control, event_handler > click
Occurs when the xtd::forms::control is clicked.
Definition control.hpp:1485
virtual const xtd::string & text() const noexcept
Gets the text associated with this control.
virtual std::optional< control_ref > parent() const noexcept
Gets the parent container of the control.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
generic_event_handler<> event_handler
Represents the method that will handle an event that has no event data.
Definition event_handler.hpp:32
#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:175
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:11
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10