• No results found

INF 8 Windows Development

N/A
N/A
Protected

Academic year: 2020

Share "INF 8 Windows Development"

Copied!
33
0
0

Loading.... (view fulltext now)

Full text

(1)

Windows Development.

Windows Forms and WPF

Subjects:

Windows Program Components

User Interface Design

Two Sets of Controls

Windows Forms Controls

WPF Controls

Properties

Methods

(2)

Introduction

Microsoft Windows programs have certain standard features that are familiar to users and that users have come to expect. Users feel more comfortable with applications that use those features. They feel safer experimenting with the program, knowing how the features will act.

Note!

(3)

Menus

(4)

Use Standard Menu Items

(5)

Context Menus

Context menus appear when the user right-clicks an object in the user interface to provide commands that are appropriate for the object that the user clicked. They are called context menus because their commands make sense in the context of the item that is clicked. (They are also sometimes called pop-up menus.)

The user interface, in the industrial design field of human – machine interaction, is the space where interaction between humans and machines occurs.

(6)

Toolbars and Ribbons

Toolbars let users access the most commonly used commands without opening a menu or context menu. They should contain buttons representing the commands that users will need the most.

The ribbon used by recent versions of some Microsoft products such as Word, Access, Excel, WordPad, and Paint is a combination of a menu and a toolbar. Tabs across the top let you pick a category of tool much as upper-level menus do. When you click a tab, that category’s tools appear below it, much as the tools in a toolbox do.

(7)

Dialog Boxes

A dialog box, or dialog, is a form that is displayed to give information to the user or to get input from the user. Dialog boxes can be either modal or modeless.

(8)

User interface design

User interface design or user interface engineering is the design of websites, computers, appliances, machines, mobile communication devices, and software applications with the focus on the user's experience and interaction.

The goal of user interface design is to make the user's interaction as simple and efficient as possible, in terms of accomplishing user goals—what is often called user-centered design. Good user interface design facilitates finishing the task at hand without drawing unnecessary attention to itself. Graphic design may be utilized to support its usability. The design process must balance technical functionality and visual elements to create a system that is not only operational but also usable and adaptable to changing user needs.

(9)

Controls

A control is a program object that represents a visible feature in a Microsoft Windows program. The object includes features that let the program manage the control to make it do things (such as making a drop-down menu open) or change the control’s appearance (such as changing a label’s text or color).

Windows programs are made up of controls. Controls include labels, text boxes, menus, combo boxes, sliders, scroll bars, and everything else you see on a form. In fact, the form itself is a control.

In addition to controls, many programs have components. A component is similar to a control except it has no visible presence of its own on the form at run time. For example, a timer component allows the program to perform some task at regular intervals. (A clock program might use a timer to update its display every second to show the current time.)

(10)

Controls

Windows Forms applications use controls and graphical methods that have been around for years. In contrast, WPF controls use a newer graphical subsystem that has been available since the Microsoft .NET Framework version 3.0 and that is more closely integrated into the DirectX libraries that include high-performance graphics routines. That allows WPF controls to take better advantage of the computer’s graphics hardware, giving them a richer appearance and better performance. WPF provides many benefits, including the following:

More efficient use of graphics hardware;

Property binding to provide property animation;

Property inheritance to promote a consistent appearance; Styles to give controls a consistent appearance;

Templates to give controls new behaviors; A richer control-containment model;

(11)

Using Controls

(12)

Windows Forms Controls

(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)

WPF Controls

Just as Windows Forms has a set of controls, WPF does as well. Many of these are functionally similar to Windows Forms controls, but some are new, and many of the controls — even the common ones — are somewhat different, either in appearance, in functionality, or both.

Note! The thing you normally call a form in a Windows Forms program is called a window in a WPF application.

(21)
(22)
(23)
(24)
(25)

WPF Controls

(26)

Properties

Typically, programs interact with controls by using the controls’ properties, methods, and events.

Windows Forms Properties

Properties are attributes that determine a control’s appearance or behavior.

For example, a Label control’s Text property determines the text displayed by the control. For an example of a property determining a control’s behavior, the ListBox control’s Sorted property determines whether the control sorts its items.

(27)

WPF Control Properties

(28)

WPF Control Properties

WPF controls use brushes to determine their colors:

(29)

Methods

A method is a piece of code that you can call to make a control do something. A simple example is the TextBox control’s Clear method, which makes the control clear its contents. The exact syntax for calling these methods depends on the programming language you’re using.

(30)

Events

A third way that a program can interact with a control is by using events. An event is a mechanism that lets a control tell the program that something interesting has occurred. When something interesting occurs, a control raises the event. The program can catch or handle the event and take whatever action is appropriate. It might display new output to the user, start performing some task, or close the application. The code that processes the event is called an event handler.

(31)
(32)

Events

WPF controls support many of the same (or similar) events provided by Windows Forms controls.

Controls and components define a program’s user interface. In addition to a user interface, most programs have extensive code behind the scenes to provide the program’s functionality.

For example, a simple drawing program would need code to save and load files, change drawing tools, modify the current drawing, and ensure that changes are saved before closing.

(33)

References

Related documents

The matched t-tests that were run were interpreted according to the new level of significance (p < 0.017). The descriptive statistics information for the performance of group A

an d M ar tin G lin z Homonym Oмоним Inspection Инспекция Kind of requirement Вид требования Language Язык Maintainability Сопровождаемость

This paper describes the design and development of a multimedia project that provides instruction in locating information in a university library, evaluating the information

Staff employees (including students who also hold staff titles), and non- faculty academic employees who (a) are considering involvement in outside responsibilities for a

Middle, and West Charlotte High School of Mecklenburg County Schools Greensboro Junior League: Recording Secretary, Board of Directors, Sustainer President. Women’s

In general the results of this study indicated that (1) the addition of wax additives into the control and PMA binders decreases the viscosity, as expected; (2) the reduction rate

VM_Area areaOfOop mem { accesses VM_Word off = VM_Address.fromObjectmem.diffheapBase; from accessing a heap ‣ Read barriers are needed to prevent a NHRT Thread

This paper presents a new approach com- bining Branch and Price (B&P) with metaheuristics to derive various high-quality schedules as solutions to a nurse scheduling problem