亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

c#windows多窗體

c#windows多窗體

禍國 2017-05-21 23:39:50
?private void pictureBox2_Click(object sender, EventArgs e)? ? ? ? {? ? ? ? ? ?? ? ? ? ? ? Form2 form = new Form2();? ? ? ? ? ? form.ShowDialog();?}//這是第一窗體Form1,點擊pictureBox2即可進入窗體Form2;下面是Form1;using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace ll{? ? public partial class Form2 : Form? ? {? ? ? ? public Form2()? ? ? ? {? ? ? ? ? ? InitializeComponent();? ? ? ? }? ? ? ? private void label1_Click(object sender, EventArgs e)? ? ? ? {? ? ? ? }? ? ? ? private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)? ? ? ? {? ? ? ? ??? ? ? ? }? ? ? ? private void button1_Click(object sender, EventArgs e)? ? ? ? {? ? ? ? ? ? if (this.openFileDialog1.ShowDialog() == DialogResult.OK)? ? ? ? ? ? {? ? ? ? ? ? ? ? this.textBox1.Text = this.openFileDialog1.FileName;? ? ? ? ? ? }? ? ? ? }? ? ? ? private void timer1_Tick(object sender, EventArgs e)? ? ? ? {? ? ? ? ? ? if (DateTime.Now.ToShortTimeString() == this.textBox2.Text.Trim().ToString())? ? ? ? ? ? {? ? ? ? ? ? ? ? this.axWindowsMediaPlayer1.URL = this.textBox1.Text; //設置音樂文件的播放路徑? ? ? ? ? ? ? ? this.axWindowsMediaPlayer1.Ctlcontrols.play(); //播放多媒體文件? ? ? ? ? ? ? ? this.timer1.Enabled = false; //關閉timer1計時器? ? ? ? ? ? ? ? this.timer2.Enabled = true; //啟動timer2計時器? ? ? ? ? ? ? ? this.timer2.Interval = 1000; //設置timer2計時器的Tick事件間隔為1s? ? ? ? ? ? ? ? this.Show(); //顯示該窗體? ? ? ? ? ? }? ? ? ? }? ? ? ? private void button2_Click(object sender, EventArgs e)? ? ? ? {? ? ? ? ? ? this.timer1.Enabled = true;? ? ? ? ? ?this.Hide();? ? ? ? ? ? this.ShowInTaskbar = false ?;? ? ? ? }? ? ? ? private void button3_Click(object sender, EventArgs e)? ? ? ? {? ? ? ? ? ? Application.Exit();? ? ? ? }? ? ? ?? ? ? ? private void timer2_Tick(object sender, EventArgs e)? ? ? ? {? ? ? ? ? ? if (this.axWindowsMediaPlayer1.status != "正在播放") //當多媒體處于正在播放的狀態時? ? ? ? ? ? {? ? ? ? ? ? ? ? this.timer2.Enabled = false; //關閉timer2計時器? ? ? ? ? ? ? ? MessageBox.Show("本次播放已完成,謝謝使用?。?!"); //彈出信息提示? ? ? ? ? ? }? ? ? ? }? ? }}//From2是一個鬧鐘,//問題來了,我這個鬧鐘Form2如果不通過Form1進入form2設定時間是可以用的,但用了多窗體之后鬧鈴不響了
查看完整描述

目前暫無任何回答

  • 0 回答
  • 1 關注
  • 1334 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號