示例#1
0
		private void btnEdit_Click(object sender, EventArgs e)
		{
			int index = -1;
			if (lstPlay.Items.Count == 0)
			{
				MessageBox.Show("请选中!", "提示");
				return;
			}
			string s = "";
			try
			{
				s = lstPlay.Items[lstPlay.SelectedIndices[0]].Text;
			}
			catch
			{
				MessageBox.Show("请选中!", "提示");
				return;
			}
			string tree = "";
			try
			{
				tree = treeView.SelectedNode.Text;
			}
			catch
			{
				MessageBox.Show("请选中!", "提示");
				return;
			}
			if (s.Contains("word"))
			{
				index = 0;
			}
			else if (s.Contains("表"))
			{
				index = 2;
			}
			else
			{
				index = 1;
			}
			switch (index)
			{
				case 0:
					WordFrm wordFrm = new WordFrm(s, tree, true);
					wordFrm.ShowDialog();
					break;
				case 1:
					TxtFrm txtFrm = new TxtFrm(s, tree);
					txtFrm.ShowDialog();
					break;
				case 2:
					TableFrm tFrm = new TableFrm(tree);
					tFrm.ShowDialog();
					break;
				default:
					break;
			}
		}
示例#2
0
		private void picBtnTable_Click(object sender, EventArgs e)
		{
			foreach (ListViewItem i in lstPlay.Items)
			{
				if (i.Text.Contains("表"))
				{
					MessageBox.Show(treeView.SelectedNode.Text + "中只能设置一张表格", "提示");
					return;
				}
			}
			string tree = treeView.SelectedNode.Text;
			TableFrm f = new TableFrm(tree);
			f.ShowDialog();
		}