資源簡介
鼠標(biāo)點(diǎn)擊左鍵,畫多邊形。畫完一個(gè)多邊形之后,雙擊窗體,然后開始畫第二個(gè)多邊形

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
namespace?mapManage
{
????public?partial?class?areaImgList?:?Form
????{
????????int?pageSize?=?0;?????//每頁顯示行數(shù)
????????int?nMax?=?0;?????????//總記錄數(shù)
????????int?pageCount?=?0;????//頁數(shù)=總記錄數(shù)/每頁顯示行數(shù)
????????int?pageCurrent?=?0;???//當(dāng)前頁號(hào)
????????int?nCurrent?=?0;??????//當(dāng)前記錄行
????????DataSet?ds?=?new?DataSet();
????????DataTable?dtInfo?=?new?DataTable();
????????string?strWhere?=?string.Empty;//查詢條件
????????public?static?string?areaId?=?string.Empty;//記錄一個(gè)熱區(qū)的區(qū)域id
????????public?areaImgList()
????????{
????????????InitializeComponent();
????????}
????????private?void?areaImgList_Load(object?sender?EventArgs?e)
????????{
????????????ds=new?areaImageDal().GetList(““);
????????????if?(ds?!=?null?&&?ds.Tables[0].Rows.Count?>?0)
????????????{
????????????????comboBox1.DataSource?=?ds.Tables[0];
????????????????comboBox1.DisplayMember?=?“name“;
????????????????comboBox1.ValueMember?=?“id“;
????????????????comboBox1.Text?=?“--請(qǐng)選擇--“;
????????????????strWhere?=?“?areaId=“?+?comboBox1.SelectedValue.ToString();
????????????}
????????????dtInfo?=?new?areaPointDal().GetListView(strWhere).Tables[0];
????????????InitDataSet();
????????}
????????private?void?InitDataSet()
????????{
????????????pageSize?=?20;??????//設(shè)置頁面行數(shù)
????????????nMax?=?dtInfo.Rows.Count;
????????????pageCount?=?(nMax?/?pageSize);????//計(jì)算出總頁數(shù)
????????????if?((nMax?%?pageSize)?>?0)
????????????{?
????????????????pageCount++;
????????????}
????????????pageCurrent?=?1;????//當(dāng)前頁數(shù)從1開始
????????????nCurrent?=?0;???????//當(dāng)前記錄數(shù)從0開始
????????????LoadData();
????????}
????????private?void?LoadData()
????????{
????????????int?nStartPos?=?0;???//當(dāng)前頁面開始記錄行
????????????int?nEndPos?=?0;?????//當(dāng)前頁面結(jié)束記錄行
????????????DataTable?dtTemp?=?dtInfo.Clone();???//克隆DataTable結(jié)構(gòu)框架
????????????if?(pageCurrent?==?pageCount)
????????????{
????????????????nEndPos?=?nMax;
????????????}
????????????else
????????????{
????????????????nEndPos?=?pageSize?*?pageCurrent;
????????????}
????????????nStartPos?=?nCurrent;
????????????lblPageCount.Text?=?pageCount.ToString();
????????????txtCurrentPage.Text?=?Convert.ToString(pageCurrent);
????????????//從元數(shù)據(jù)源復(fù)制記錄行
????????????for?(int?i?=?nStartPos;?i?????????????{
????????????????dtTemp.ImportRow(dtInfo.Rows[i]);
????????????????nCurrent++;
????????????}
????????????bdsInfo.DataSource?=?dtTemp;
????????????bdnInfo.BindingSource?=?bdsInfo;
????????????dgvInfo.DataSource?=?bdsInfo;
????????}
????????private?void?bdnInfo_ItemClicked(object?sender?ToolStripItemClickedEventArgs?e)
????????{
????????????if?(e.ClickedItem.Text?==?“關(guān)閉“)
????????????{
????????????????this.Close();
????????????}
????????????if?(e.ClickedItem.Text?==?“上一頁“)
????????????{
????????????????pageCurrent--;
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????4981??2011-08-24?16:29??demo\mapManage\mapManage\areaImgList.cs
?????文件??????22232??2011-08-24?16:29??demo\mapManage\mapManage\areaImgList.Designer.cs
?????文件??????13041??2011-08-24?16:29??demo\mapManage\mapManage\areaImgList.resx
?????文件??????91648??2011-08-29?11:59??demo\mapManage\mapManage\bin\Debug\mapManage.exe
?????文件??????85504??2011-08-29?11:59??demo\mapManage\mapManage\bin\Debug\mapManage.pdb
?????文件??????14328??2011-08-29?11:47??demo\mapManage\mapManage\bin\Debug\mapManage.vshost.exe
?????文件???????1200??2011-08-22?14:10??demo\mapManage\mapManage\class\areaImage.cs
?????文件???????7010??2011-08-22?14:20??demo\mapManage\mapManage\class\areaImageDal.cs
?????文件???????1107??2011-08-22?14:14??demo\mapManage\mapManage\class\areaPoint.cs
?????文件???????7454??2011-08-24?14:58??demo\mapManage\mapManage\class\areaPointDal.cs
?????文件???????2147??2011-08-22?13:43??demo\mapManage\mapManage\class\SqlHelper.cs
?????文件???????3972??2011-08-29?11:58??demo\mapManage\mapManage\editHotArea.cs
?????文件???????7131??2011-08-29?11:58??demo\mapManage\mapManage\editHotArea.Designer.cs
?????文件???????5814??2011-08-29?11:58??demo\mapManage\mapManage\editHotArea.resx
?????文件???????5214??2011-08-29?11:46??demo\mapManage\mapManage\editHotPoint.cs
?????文件???????6503??2011-08-29?11:45??demo\mapManage\mapManage\editHotPoint.Designer.cs
?????文件???????5814??2011-08-29?11:45??demo\mapManage\mapManage\editHotPoint.resx
?????文件???????3953??2011-08-24?15:13??demo\mapManage\mapManage\imgList.cs
?????文件??????25307??2011-08-24?15:13??demo\mapManage\mapManage\imgList.Designer.cs
?????文件??????11216??2011-08-24?15:13??demo\mapManage\mapManage\imgList.resx
?????文件???????5482??2011-08-29?11:08??demo\mapManage\mapManage\mapManage.csproj
?????文件???????4193??2011-08-29?11:59??demo\mapManage\mapManage\obj\Debug\mapManage.areaImgList.resources
?????文件????????791??2011-08-29?11:59??demo\mapManage\mapManage\obj\Debug\mapManage.csproj.FileListAbsolute.txt
?????文件???????1141??2011-08-29?11:59??demo\mapManage\mapManage\obj\Debug\mapManage.csproj.GenerateResource.Cache
?????文件????????180??2011-08-29?11:59??demo\mapManage\mapManage\obj\Debug\mapManage.editHotArea.resources
?????文件????????180??2011-08-29?11:59??demo\mapManage\mapManage\obj\Debug\mapManage.editHotPoint.resources
?????文件??????91648??2011-08-29?11:59??demo\mapManage\mapManage\obj\Debug\mapManage.exe
?????文件???????4193??2011-08-29?11:59??demo\mapManage\mapManage\obj\Debug\mapManage.imgList.resources
?????文件??????85504??2011-08-29?11:59??demo\mapManage\mapManage\obj\Debug\mapManage.pdb
?????文件??????34984??2011-08-29?11:59??demo\mapManage\mapManage\obj\Debug\mapManage.Properties.Resources.resources
............此處省略35個(gè)文件信息
評(píng)論
共有 條評(píng)論