FrmXuanGe.cs
资源名称:KTV.rar [点击查看]
上传用户:fzwcsgshou
上传日期:2022-07-30
资源大小:28414k
文件大小:3k
源码类别:
行业应用
开发平台:
Visual C++
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace KTV
- {
- public partial class FrmXuanGe : Form
- {
- public FrmXuanGe()
- {
- InitializeComponent();
- }
- private void FrmXuanGe_Load(object sender, EventArgs e)
- {
- dataGridView1.DataSource = ds.Tables[0];
- dsList.Tables.Add();
- dsList.Tables[0].Columns.Add("歌曲名称");
- dsList.Tables[0].Columns.Add("存放位置");
- listBox1.DisplayMember = "歌曲名称";
- listBox1.ValueMember = "存放位置";
- listBox1.DataSource = dsList.Tables[0];
- }
- public DataSet ds = new DataSet();
- public DataSet dsList = new DataSet();
- private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int i = 0;
- dsList.Tables[0].Rows.Add();
- i = dsList.Tables[0].Rows.Count - 1;
- dsList.Tables[0].Rows[i]["歌曲名称"] = dataGridView1.CurrentRow.Cells["歌曲名称"].Value.ToString()+"--"+
- dataGridView1.CurrentRow.Cells["歌手"].Value.ToString();
- dsList.Tables[0].Rows[i]["存放位置"] = dataGridView1.CurrentRow.Cells["存放位置"].Value.ToString();
- KTVData.KTVDB.DianBo(int.Parse(dataGridView1.CurrentRow.Cells["歌曲编号"].Value.ToString()));
- }
- private void button2_Click(object sender, EventArgs e)
- {
- dsList.Tables[0].Rows.RemoveAt(listBox1.SelectedIndex);
- }
- private void button3_Click(object sender, EventArgs e)
- {
- if (listBox1.Items.Count > 0)
- {
- if (FrmMain.FrmBoFang1.listBox1.Items.Count < 1)
- {
- FrmBoFang.ds.Merge(dsList.Tables[0]);
- FrmMain.FrmBoFang1.axWindowsMediaPlayer1.URL = FrmMain.FrmBoFang1.listBox1.SelectedValue.ToString();
- }
- else
- {
- FrmBoFang.ds.Merge(dsList.Tables[0]);
- }
- }
- this.Close();
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- MessageBox.Show("需要硬件设备支持!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- }