SlideServe
Menu
Préférences
© SlideServe · v2026

Graphical User Interface (GUI)

swain avatar
11 diapositives · 345 Views · Aug 08, 2014

Graphical User Interface (GUI). A GUI allows user to interact with a program visually. GUIs are built from GUI components. A GUI component is an object with which the user interacts via the mouse and keyboard. Some basic components. Label - An area in which icons or text can be displayed

Graphical User Interface (GUI) - slide 1
01 / 11Graphical User Interface (GUI)
1 / 17

Télécharger la présentation

Graphical User Interface (GUI)
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Graphical User Interface(GUI) • A GUI allows user to interact with a program visually. • GUIs are built from GUI components. • A GUI component is an object with which the user interacts via the mouse and keyboard.

  2. Some basic components • Label - An area in which icons or text can be displayed • TextBox – An area in which user inputs data • Button – An area that triggers an event when clicked • CheckBox –A GUI control that is either selected or not selected • ComboBox – A drop-down list of items from which the user can make a selection • ListBox – An area in which a list of items is displayed • Panel – A container in which components can be placed • HScrollBar – A horizontal scroll bar. • VScrollBar – A vertical scroll bar.

  3. Window form • A form is a graphical element that appears on the desktop. • A form can be a dialog, an SDI window (single document interface window) or an MDI window (multiple document interface window)

  4. Form property and events • Common properties • AcceptButton – specifies which button will be clicked when user press enter • AutoScroll – specifies whether scrollbars appear when needed • CancelButton – specifies which button is clicked when user presses Esc • FormBorderStyle – specifies the border of the form • Font -specifies the font of text displayed in the form as well as the default font of controls added to the form • Text – specifies the text in the form’s title bar

  5. Form properties and events • Common methods • Close – closes form. • Hide – hides form • Show – display a hidden form • Common events • Load – occurs before a form is shown

  6. Basic event handling • Double-click the click event in the property window to create an empty event handler in the program code private: System::void formName_Click(System::Object *sender, System::EventArgs *e) { MessageBox::Show(S”Form was pressed”); };

  7. Register event-handler with delegate • After creating the event-handler, we must register it with the delegate, which contains a list of event handlers to call. • Controls have a delegate for each of their events • The delegate has the same name as the event • If we are handling event EventName for object myControl, then the delegate pointer is myControl->EventName • .NET registers events for us this->Click += new System::EventHandler(this, Form1_Click); • The first argument to the EventHandler constructor is a pointer to the object that contains the method specified as the second argument. • Form1_click is a method of class Form1. The first argument will be 0 if the method is static method

  8. Control properties • BackColor: background color of the control • Text: text associated with the control • TextAlign: The alignment of the text on the control. • Font:Font used to display control’s text • ForeColor: Foreground color of the control. Usually color of the text • Focused: specifies whether the control has focus • Visible: specifies whether the control is visible

  9. Common methods • Focus: Transfer the focus to the control • Hide: Hides the control( equivalent to setting Visible to false) • Show: shows the control(equivalent to setting Visible to true)

  10. Control layout • Anchor: anchoring allows control to stay a fixed distance from the sides of the container, even when the control is resized • Dock: docking allows control to extend themselves along the sides of their containers • Fill dock option effectively docks the control to all sides of its parent • Dockpadding sets the distance from docked controls to the edge of the form.

  11. Create window form project • From File->new -> project • Select window form application(.Net) • Click view->toolbox if toolbox is not open • Drag and drop the controls to design GUI