You are on page 1of 2

Trng i Hc Cng Nghip Tp.

HCM Khoa Cng Ngh Thng Tin 2 THI THC HNH (GK)- 2D - lp DHTH5A 90 pht- khng c php s dng ti liu. 2 - Nhm 2- 8:45, 21/2/2012
using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms;

namespace treeview { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { them(); } void them() { TreeNode tn = null; for (char s = 'A'; s <= 'Z'; s++) { tn = treeView1.Nodes.Add(s.ToString()); //TreeNode a = tn.Nodes.Add("phan thanh dong"); } } private void button1_Click(object sender, EventArgs e) { string a = (textBox1.Text).Substring(0, 1).ToUpper().ToString(); string b = ""; TreeNode n=null; foreach (TreeNode tr in treeView1 .Nodes ) { b = tr.Text; if (a.Equals(b)) { n = tr.Nodes.Add(textBox1.Text); treeView1.ExpandAll(); treeView1.SelectedNode = tr; } } } } }

Trng i Hc Cng Nghip Tp. HCM Khoa Cng Ngh Thng Tin 2 Lu : To 1 project C# vi 1 form duy nht thc hin c 4 cu. Trn form c 4 button ng vi 4 cu click chn cu thc hin. Cu 1 (1) Thit k v v hnh theo mu sau gc tri di ca form1 (khng bt buc dng DDA line):

Cu 2 (2) Tnh tin hnh cu 1 ra gia form1. Cu 3: (4) Dng php quay to thm 4 hnh khc, c hnh kt qu dng chong chng nh sau:

Bit php quay quanh im C(xr,yr) mt gc alpha c ma trn:

Cu 4 (2) - Ci t phng thc t mu theo mt trong nhng thut ton m em bit. Sau t mu cho 5 cnh ca chong chng cu 3.

Cu 5: (1) Cho chong chng (c t mu) quay u quanh tm ca n cho n khi nhn button cu 5 ln na th dng.

You might also like