Message Box
- Contents
- Compiling
- Running
- Under the Hood
- Notes
Compiling
To compile the example:
- Launch EiffelStudio.
- Click Add project
- Browse to $ISE_EIFFEL\examples\dotnet\winforms\hello_world_dlg\
- Choose hello_world_dlg.ecf
- Choose the location where the project will be compiled, by default the same directory containing the configuration file.
- Click Open.
Running
After launching the application, you will see a window displayed with a similar appearance to the one above.
Click on the BUTTON
"Click Me!" and a message box will appear with the text that you have entered in the TEXT_BOX
.
Under the Hood
The application shows how to use the very useful MESSAGE_BOX
control.
An event ( EVENT_HANDLER
) is associated to a control (here to the BUTTON
). So the line my_button.add_click (create {EVENT_HANDLER}.make (Current, $on_my_button_clicked ))
associates a click to my_button to the feature on_my_button_clicked
. So every time the BUTTON my_button
is clicked, the feature on_my_button_clicked is executed.
The feature my_button_clicked
displays a MESSAGE_BOX
{WINFORMS_MESSAGE_BOX}.show (msg)
with the text contained in TEXT_BOX
msg := "Text is : '" msg.append (my_text_box.text) msg.append ("'")
This sample uses the following classes:
-
FORM
-
BUTTON
-
TEXT_BOX
-
EVENT_HANDLER
Notes
This sample is translated from the example located in the QuickStart\winforms\samples\accessible subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio.NET.