Chapter 11 Advanced Topics in Windows Forms - Pdf 13

1
Week 10
Chapter 11. Advanced Topics in
Windows Forms
Chapter 12. Enhancing Usability
Chapter 15: Crystal Report
Chapter 11. Advanced Topics
in Windows Forms

11.1 Drag-Drop (P523)

11.2 MDI (P543)
2
11.1 Drag-Drop (P523)

Windows users fall into two general
categories:

use the keyboard

use the mouse

Drag and drop: same as cutting and pasting
using keyboard
11.1 Drag-Drop (P523)
Sequence of events

Dragging is initiated (call DoDragDrop for the source )

The DoDragDrop method takes two parameters:


(DataFormats.Text))
e.Effect =
DragDropEffects.Copy;
+DragDrop
TXT2.Text =
(string)e.Data.GetData (
DataFormats.Text);
Drag-Drop: demo: Textbox

Using Textbox

Step1: DragEnter event

Step2: DragDrop event

Step3: MouseDown event
4
Drag-Drop: demo: PictureBox

AllowDrop

DragEnter

DragDrop

KeyState
11.1 Drag-Drop (P523) -
demo: treeview

Example: Drag-Drog in Treeview


Array

ArrayList

List<generic>
6
11.2 MDI

parent form/child form model.

Has a single parent form

The parent form organizes and
arranges all of the child documents that
are currently open.
11.2 MDI

What is an MDI Form?

Multiple-document interface (MDI)
applications allow you to display multiple
documents at the same time, with each
document displayed in its own window.
7
11.2 MDI

How do I create an MDI Parent form ?

Creating an MDI Parent Form

{}

}

}
8
11.2 MDI

Identifying the Active Child Form

Form aForm;

aForm = this.ActiveMDIChild;
11.2 MDI

Arranging MDI Child Forms

this.LayoutMdi(System.Windows.Forms.Mdi
Layout.Cascade);
9
11.2 MDI

Window List Menu

MenuStrip component

Set the MdiWindowListItem property to the
menu item
11.2 MDI



The ProgressBar Control

StatusStrip Control

ToolTip Component

ErrorProvider Component

HelpProvider Component
Chapter 12. Using User Assistance
Controls and Components

The ProgressBar Control

Visually indicate progress for a time-
consuming operation.

Maximum, Minimum, Value, Step
progressBar1.Minimum = 0;
progressBar1.Maximum = 100;
progressBar1.Step = 1;
for (int i = 0; i < 101; i++)
{
CopyFiles(i);
progressBar1.PerformStep();
}
11
Chapter 12. Using User Assistance
Controls and Components


Turn on

errorProvider1.SetError(TextBox1, "Value must
be numeric");

Turn off

errorProvider1.SetError(TextBox1, "");
Chapter 15: Report
13
Chapter 15: Crystal Report

Crystal Report File

Crystal Report Viewer
Chapter 15: Crystal Report

1. Create Type Dataset

2. Create Crystal Report Template

Menu Project -> Add new item -> Crystal Report

->Using Report Wizard->choose Typed-Dataset-
>…

3. Create CrystalReport Viewer

4. Code to connect objects…


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status