xtd 0.2.0
Loading...
Searching...
No Matches

◆ use_wait_cursor() [1/2]

static bool xtd::forms::application::use_wait_cursor ( )
staticnoexcept

Gets whether the wait cursor is used for all open forms of the application.

Returns
true is the wait cursor is used for all open forms; otherwise, false.
Remarks
When this property is set to true, the use_wait_cursor property of all open forms in the application will be set to true. This call will not return until this property has been set on all forms. Use this property when you have a long-running operation, and want to indicate in all application forms that the operation is still processing.
Examples
The following code example demonstrates the use of application use wait cursor property.
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/threading/thread>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Application use wait cursor example");
button1.auto_size(true);
button1.location({10, 10});
button1.parent(*this);
button1.text("Do something...");
button1.click += [] {
application::use_wait_cursor(true);
for (auto count = 0; count < 500; ++count) {
application::do_events();
threading::thread::sleep(10_ms); // Simulate work...
}
application::use_wait_cursor(false);
};
}
private:
};
auto main() -> int {
}
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a Windows button control.
Definition button.h:49
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:54
@ button1
The first button on the message box is the default button.
@ text
The xtd::forms::status_bar_panel displays text in the standard font.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10