xtd 0.2.0
auto_scroll.cpp

demonstrates the use of xtd::forms::panel.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/panel>
using namespace xtd::drawing;
using namespace xtd::forms;
namespace auto_scroll_example {
class form1 : public form {
public:
form1() {
auto_scroll(true);
controls().push_back_range({panel5, panel4, panel3, panel2, panel1});
size({400, 250});
text("Auto scroll example");
panel1.border_style(border_style::fixed_single).back_color(color::light_green).dock(dock_style::top);
panel2.border_style(border_style::fixed_single).back_color(color::light_pink).dock(dock_style::top);
panel3.border_style(border_style::fixed_single).back_color(color::light_blue).dock(dock_style::top);
panel4.border_style(border_style::fixed_single).back_color(color::light_yellow).dock(dock_style::top);
panel5.border_style(border_style::fixed_single).back_color(color::light_salmon).dock(dock_style::top);
}
private:
panel panel1;
panel panel2;
panel panel3;
panel panel4;
panel panel5;
};
}
auto main() -> int {
application::run(auto_scroll_example::form1 {});
}
static const xtd::drawing::color light_yellow
Gets a system-defined color that has an ARGB value of 0xFFFFFFE0. This field is constant.
Definition color.hpp:284
static const xtd::drawing::color light_blue
Gets a system-defined color that has an ARGB value of 0xFFADD8E6. This field is constant.
Definition color.hpp:248
static const xtd::drawing::color light_green
Gets a system-defined color that has an ARGB value of 0xFF90EE90. This field is constant.
Definition color.hpp:263
static const xtd::drawing::color light_salmon
Gets a system-defined color that has an ARGB value of 0xFFFFA07A. This field is constant.
Definition color.hpp:269
static const xtd::drawing::color light_pink
Gets a system-defined color that has an ARGB value of 0xFFFFB6C1. This field is constant.
Definition color.hpp:266
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Used to group collections of controls.
Definition panel.hpp:32
@ fixed_single
A single-line border. Same as xtd::forms::border_style::solid.
Definition border_style.hpp:56
@ top
The control's top edge is docked to the top of its containing control.
Definition dock_style.hpp:27
The xtd::drawing::text namespace provides advanced GDI+ typography functionality.
Definition font_collection.hpp:14
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:217
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31